Skip to content

Instantly share code, notes, and snippets.

@ganzuul
Created April 29, 2020 18:56
Show Gist options
  • Save ganzuul/f85d3cfc4f2e9a93489d88f775f4b1c4 to your computer and use it in GitHub Desktop.
Save ganzuul/f85d3cfc4f2e9a93489d88f775f4b1c4 to your computer and use it in GitHub Desktop.
tasks.json for VSCode to build and run C++ on Linux
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "g++ build active file",
"command": "/usr/bin/g++",
"args": [
"-g",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}"
],
"options": {
"cwd": "/usr/bin"
},
"problemMatcher": [
"$gcc"
]
},
{
"label": "run",
"type": "shell",
"command": "${fileDirname}/${fileBasenameNoExtension}",
},
{
"label": "build and run",
"dependsOrder": "sequence",
"dependsOn" : ["g++ build active file" , "run"],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment