代码{
"version": "2.0.0",
"tasks": [
{
"label": "clang++ build",
"type": "shell",
"command": "clang++",
"args": [
"-std=c++17",
"-g",
"-O2",
"-fstandalone-debug",
"-ferror-limit=5",
"-Wall",
"-Wextra",
"-Wpedantic",
"-o",
"${workspaceFolder}/bin/${fileBasenameNoExtension}",
"${file}"
],
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared"
},
"problemMatcher": {
"owner": "cpp",
"fileLocation": ["relative", "${workspaceFolder}"],
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
},
{
"label": "clang build project",
"type": "shell",
"command": "clang++",
"args": [
"-std=c++17",
"-g",
"-O2",
"-fstandalone-debug",
"-ferror-limit=5",
"-Wall",
"-Wextra",
"-Wpedantic",
"-I${workspaceFolder}/include",
"-o",
"${workspaceFolder}/build/main",
"${workspaceFolder}/src/*.cpp"
],
"group": "build",
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared"
},
"problemMatcher": {
"owner": "cpp",
"fileLocation": ["relative", "${workspaceFolder}"],
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
}
]
}
代码{
"C++ Clang Build Tasks": {
"prefix": "cpp-tasks",
"body": [
"{",
" \"version\": \"2.0.0\",",
" \"tasks\": [",
" {",
" \"label\": \"clang++ build\",",
" \"type\": \"shell\",",
" \"command\": \"clang++\",",
" \"args\": [",
" \"-std=c++17\",",
" \"-g\",",
" \"-O2\",",
" \"-fstandalone-debug\",",
" \"-ferror-limit=5\",",
" \"-Wall\",",
" \"-Wextra\",",
" \"-Wpedantic\",",
" \"-o\",",
" \"\\${workspaceFolder}/bin/\\${fileBasenameNoExtension}\",",
" \"\\${file}\"",
" ],",
" \"group\": {",
" \"kind\": \"build\",",
" \"isDefault\": true",
" },",
" \"presentation\": {",
" \"echo\": true,",
" \"reveal\": \"always\",",
" \"focus\": false,",
" \"panel\": \"shared\"",
" },",
" \"problemMatcher\": {",
" \"owner\": \"cpp\",",
" \"fileLocation\": [\"relative\", \"\\${workspaceFolder}\"],",
" \"pattern\": {",
" \"regexp\": \"^(.*):(\\\\\\d+):(\\\\\\d+):\\\\\\s+(warning|error):\\\\\\s+(.*)$\",",
" \"file\": 1,",
" \"line\": 2,",
" \"column\": 3,",
" \"severity\": 4,",
" \"message\": 5",
" }",
" }",
" },",
" {",
" \"label\": \"clang build project\",",
" \"type\": \"shell\",",
" \"command\": \"clang++\",",
" \"args\": [",
" \"-std=c++17\",",
" \"-g\",",
" \"-O2\",",
" \"-fstandalone-debug\",",
" \"-ferror-limit=5\",",
" \"-Wall\",",
" \"-Wextra\",",
" \"-Wpedantic\",",
" \"-I\\${workspaceFolder}/include\",",
" \"-o\",",
" \"\\${workspaceFolder}/build/main\",",
" \"\\${workspaceFolder}/src/*.cpp\"",
" ],",
" \"group\": \"build\",",
" \"presentation\": {",
" \"echo\": true,",
" \"reveal\": \"always\",",
" \"focus\": false,",
" \"panel\": \"shared\"",
" },",
" \"problemMatcher\": {",
" \"owner\": \"cpp\",",
" \"fileLocation\": [\"relative\", \"\\${workspaceFolder}\"],",
" \"pattern\": {",
" \"regexp\": \"^(.*):(\\\\\\d+):(\\\\\\d+):\\\\\\s+(warning|error):\\\\\\s+(.*)$\",",
" \"file\": 1,",
" \"line\": 2,",
" \"column\": 3,",
" \"severity\": 4,",
" \"message\": 5",
" }",
" }",
" }",
" ]",
"}"
],
"description": "C++ build tasks for clang++ with LLDB"
}
}