Skip to content

Instantly share code, notes, and snippets.

@bietdoikiem
Last active April 22, 2022 16:08
Show Gist options
  • Save bietdoikiem/cca4858402f5c789763c2053b797bb77 to your computer and use it in GitHub Desktop.
Save bietdoikiem/cca4858402f5c789763c2053b797bb77 to your computer and use it in GitHub Desktop.
Tasks to build C++ with a single file
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "Make a bin directory",
"command": "mkdir -p bin"
},
{
"type": "cppbuild",
"label": "C/C++: g++-11 build active file",
"command": "/opt/homebrew/bin/g++-11",
"args": [
"-std=c++20",
"-g",
"-D_GLIBCXX_DEBUG",
"-D_GLIBCXX_DEBUG_PEDANTIC",
"-Wall",
"-Wextra",
"-O2",
"${file}",
"-o",
"${fileDirname}/bin/${fileBasenameNoExtension}"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": ["$gcc"],
"group": "build",
"detail": "compiler: /opt/homebrew/bin/g++-11",
"dependsOn": ["Make a bin directory"]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment