62 lines
1.0 KiB
Markdown
62 lines
1.0 KiB
Markdown
---
|
||
tags:
|
||
- 代码块
|
||
- 编译
|
||
---
|
||
vscode中同时编译多个源文件,`task.json`配置如下:
|
||
```json
|
||
{
|
||
|
||
"tasks": [
|
||
|
||
{
|
||
|
||
"type": "cppbuild",
|
||
|
||
"label": "C/C++: gcc.exe build active file",
|
||
|
||
"command": "D:\\mingw64\\bin\\gcc.exe",
|
||
|
||
"args": [
|
||
|
||
"-fdiagnostics-color=always",
|
||
|
||
"-g", "${workspaceFolder}\\*.c",
|
||
|
||
"-I", "${workspaceFolder}",
|
||
|
||
"-o", "${workspaceFolder}\\${fileBasenameNoExtension}.exe"
|
||
|
||
],
|
||
|
||
"options": {
|
||
|
||
"cwd": "${fileDirname}"
|
||
|
||
},
|
||
|
||
"problemMatcher": [
|
||
|
||
"$gcc"
|
||
|
||
],
|
||
|
||
"group": {
|
||
|
||
"kind": "build",
|
||
|
||
"isDefault": true
|
||
|
||
},
|
||
|
||
"detail": "Task generated by Debugger."
|
||
|
||
}
|
||
|
||
],
|
||
|
||
"version": "2.0.0"
|
||
|
||
}
|
||
```
|
||
` |