You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
2.0 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

// https://code.visualstudio.com/docs/editor/tasks
{
"version": "2.0.0",
"tasks": [
{
"label": "Compile", // 任务名称与launch.json的preLaunchTask相对应
"command": "g++", // 要使用的编译器C++用g++
"args": [
"${file}",
"-o", // 指定输出文件名不加该参数则默认输出a.exeLinux下默认a.out
"${fileDirname}\\${fileBasenameNoExtension}.exe",
"-g", // 生成和调试有关的信息
"-Wall", // 开启额外警告
"-static-libgcc", // 静态链接libgcc一般都会加上
"-fexec-charset=GBK", // 生成的程序使用GBK编码不加这一条会导致Win下输出中文乱码
"-std=c++11", // C++最新标准为c++17或根据自己的需要进行修改
], // 编译的命令其实相当于VSC帮你在终端中输了这些东西
"type": "process", // process是vsc把预定义变量和转义解析后直接全部传给commandshell相当于先打开shell再输入命令所以args还会经过shell再解析一遍
"group": {
"kind": "build",
"isDefault": true // 不为true时ctrl shift B就要手动选择了
},
"presentation": {
"echo": true,
"reveal": "always", // 执行任务时是否跳转到终端面板可以为alwayssilentnever。具体参见VSC的文档
"focus": false, // 设为true后可以使执行task时焦点聚集在终端但对编译C/C++来说设为true没有意义
"panel": "shared" // 不同的文件的编译信息共享一个终端面板
},
},
{
"label": "commit gitee",
"type": "shell",
"command": "D:\\KeCheng\\一键推拉.cmd",
"group": {
"kind": "build",
"isDefault": true
},
}
]
}