Skip to content

Instantly share code, notes, and snippets.

@AngKokLeong
Created June 30, 2023 05:20
Show Gist options
  • Save AngKokLeong/24e9f891a47ccfd9c071efdcc67f0999 to your computer and use it in GitHub Desktop.
Save AngKokLeong/24e9f891a47ccfd9c071efdcc67f0999 to your computer and use it in GitHub Desktop.
Build Task in Visual Studio Code for CPP project Clang compiler using C++ 20
{
"version": "2.0.0",
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: clang++-11 build active file",
"command": "/usr/bin/clang++-11",
"args": [
"-fcolor-diagnostics",
"-fansi-escape-codes",
"-g",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}",
"-std=c++20"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": [
"$gcc"
],
"group": "build",
"detail": "compiler: /usr/bin/g++-11"
}
]
}
@AngKokLeong
Copy link
Author

-std=c++20 is added at Line 15 to configure clang to execute the build using C++ 20 standard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment