This repository has been archived on 2024-01-06. You can view files and clone it, but cannot push or open issues or pull requests.
justhomework/SoftwareDesign/.vscode/tasks.json

34 lines
1.8 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// https://code.visualstudio.com/docs/editor/tasks
{
"version": "2.0.0",
"tasks": [
{
"label": "Compile", // 任务名称与launch.json的preLaunchTask相对应
"command": "clang++", // 要使用的编译器
"args": [
"${file}",
"-o", // 指定输出文件名不加该参数则默认输出a.exe
"${fileDirname}/${fileBasenameNoExtension}.exe",
"-g", // 生成和调试有关的信息
"-Wall", // 开启额外警告
"-static-libgcc", // 静态链接
"-fcolor-diagnostics",
"--target=x86_64-w64-mingw", // 默认target为msvc不加这一条就会找不到头文件
"-std=c++17" // C语言最新标准为c11或根据自己的需要进行修改
], // 编译命令参数
"type": "shell",
"group": {
"kind": "build",
"isDefault": true // 设为false可做到一个tasks.json配置多个编译指令需要自己修改本文件我这里不多提
},
"presentation": {
"echo": true,
"reveal": "always", // 在“终端”中显示编译信息的策略可以为alwayssilentnever。具体参见VSC的文档
"focus": false, // 设为true后可以使执行task时焦点聚集在终端但对编译c和c++来说设为true没有意义
"panel": "shared" // 不同的文件的编译信息共享一个终端面板
}
// "problemMatcher":"$gcc" // 如果你不使用clang去掉前面的注释符并在上一条之后加个逗号。照着我的教程做的不需要改也可以把这行删去)
}
]
}