This commit is contained in:
21
.vscode/c_cpp_properties.json
vendored
Normal file
21
.vscode/c_cpp_properties.json
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Win32",
|
||||
"includePath": [
|
||||
"${workspaceFolder}/**",
|
||||
"D:\\Qt\\Qt5.14.2\\5.14.2\\mingw73_32\\include\\**"
|
||||
],
|
||||
"defines": [
|
||||
"_DEBUG",
|
||||
"UNICODE",
|
||||
"_UNICODE"
|
||||
],
|
||||
"compilerPath": "D:/mingw64/bin/g++.exe",
|
||||
"cStandard": "c17",
|
||||
"cppStandard": "gnu++14",
|
||||
"intelliSenseMode": "windows-gcc-x86"
|
||||
}
|
||||
],
|
||||
"version": 4
|
||||
}
|
||||
29
.vscode/launch.json
vendored
Normal file
29
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
{
|
||||
// 使用 IntelliSense 了解相关属性。
|
||||
// 悬停以查看现有属性的描述。
|
||||
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "debug", //修改后
|
||||
"type": "cppdbg",
|
||||
"request": "launch",
|
||||
"program": "${workspaceFolder}/build/debug/${workspaceFolderBasename}.exe", //写完整路径
|
||||
"args": [],
|
||||
"stopAtEntry": false,
|
||||
"cwd": "${workspaceFolder}", //工作目录,项目根目录
|
||||
"environment": [],
|
||||
"externalConsole": false,
|
||||
"MIMode": "gdb",
|
||||
"miDebuggerPath": "C:/Qt/Tools/mingw810_64/bin/gdb.exe", //选择MinGW中的gdb
|
||||
"setupCommands": [
|
||||
{
|
||||
"description": "为 gdb 启用整齐打印",
|
||||
"text": "-enable-pretty-printing",
|
||||
"ignoreFailures": true
|
||||
}
|
||||
],
|
||||
"preLaunchTask": "make-debug", //这跟depend[]很像啊,make就行了,用make编译出exe
|
||||
}
|
||||
]
|
||||
}
|
||||
12
.vscode/settings.json
vendored
Normal file
12
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"files.associations": {
|
||||
"qmessagebox": "cpp",
|
||||
"deque": "cpp",
|
||||
"list": "cpp",
|
||||
"string": "cpp",
|
||||
"vector": "cpp",
|
||||
"qtextstream": "cpp",
|
||||
"sstream": "cpp",
|
||||
"qfiledialog": "cpp"
|
||||
}
|
||||
}
|
||||
121
.vscode/tasks.json
vendored
Normal file
121
.vscode/tasks.json
vendored
Normal file
@ -0,0 +1,121 @@
|
||||
{
|
||||
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
||||
// for the documentation about the tasks.json format
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
//在当前项目目录创建build文件夹
|
||||
"label": "mkdir", //任务名称
|
||||
"type": "shell", //任务类型,定义任务是被作为进程运行还是在 shell 中作为命令运行。
|
||||
"options": {
|
||||
"cwd": "${workspaceFolder}" //已执行程序或脚本的当前工作目录,设置当前项目文件夹
|
||||
},
|
||||
"command": "mkdir", //命令
|
||||
"args": [ //命令后面跟的参数
|
||||
"-Force",
|
||||
"build"
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "qmake-debug",
|
||||
"type": "shell",
|
||||
"options": {
|
||||
"cwd": "${workspaceFolder}/build" //进入build目录
|
||||
},
|
||||
"command": "qmake", //qmake命令,这里没用完整路径,是因为配置到环境变量了 C:/Qt/5.15.2/mingw81_64/bin/qmake.exe
|
||||
"args": [ //跟的参数是不是很熟悉,就是上面分析出来的Qt Creator执行流程
|
||||
"../${workspaceFolderBasename}.pro", //在build目录上一级哦
|
||||
"-spec",
|
||||
"win32-g++",
|
||||
"\"CONFIG+=debug\"",
|
||||
"\"CONFIG+=console\""
|
||||
],
|
||||
"dependsOn": [ //这是本条命令依赖的前置条件,就是上面创建build文件夹的task,直接执行本task会自动先调用依赖的task
|
||||
"mkdir" //其实可以手动执行一次,后面不用每次都执行创建目录的操作
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "make-debug",
|
||||
"type": "shell",
|
||||
"options": {
|
||||
"cwd": "${workspaceFolder}/build"
|
||||
},
|
||||
"command": "mingw32-make", //MinGW这个也配置在环境变量了,不用写完整路径了 C:/Qt/Tools/mingw810_64/bin/mingw32-make.exe
|
||||
"args": [
|
||||
"-f",
|
||||
"Makefile.Debug", //-f 选择makefile,这是qmake编译出来的
|
||||
"-j7" //这个参数都知道吧,编译用的线程数量
|
||||
],
|
||||
"dependsOn": [
|
||||
"qmake-debug"
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "run-debug",
|
||||
"type": "process", //运行就不能选择shell执行了,要选择process
|
||||
"options": {
|
||||
"cwd": "${workspaceFolder}/build/debug" //没在.pro配置DESTDIR,会生成到build目录下面对应目录
|
||||
},
|
||||
"command": "${workspaceFolderBasename}.exe", //执行的exe名字,一般当前项目文件夹的名称,自定义可以写其他的
|
||||
"dependsOn": [
|
||||
"make-debug"
|
||||
]
|
||||
},
|
||||
//
|
||||
{
|
||||
"label": "qmake-release",
|
||||
"type": "shell",
|
||||
"options": {
|
||||
"cwd": "${workspaceFolder}/build"
|
||||
},
|
||||
"command": "qmake",
|
||||
"args": [ //注意release跟debug参数的差异
|
||||
"../${workspaceFolderBasename}.pro",
|
||||
"-spec",
|
||||
"win32-g++",
|
||||
"\"CONFIG+=qtquickcompiler\""
|
||||
],
|
||||
"dependsOn": [
|
||||
// "mkdir" //不用每次都创建吧
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "make-release",
|
||||
"type": "shell",
|
||||
"options": {
|
||||
"cwd": "${workspaceFolder}/build"
|
||||
},
|
||||
"command": "mingw32-make",
|
||||
"args": [
|
||||
"-f",
|
||||
"Makefile.Release", //注意release跟debug参数的差异
|
||||
"-j7"
|
||||
],
|
||||
"dependsOn": [
|
||||
"qmake-release"
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "run-release",
|
||||
"type": "process",
|
||||
"options": {
|
||||
"cwd": "${workspaceFolder}/build/release"
|
||||
},
|
||||
"command": "${workspaceFolderBasename}.exe",
|
||||
"dependsOn": [
|
||||
"make-release"
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "clean",
|
||||
"type": "shell",
|
||||
"options": {
|
||||
"cwd": "${workspaceFolder}/build"
|
||||
},
|
||||
"command": "mingw32-make",
|
||||
"args": [
|
||||
"clean"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user