Created
September 25, 2023 16:13
-
-
Save jeffjohnson9046/32c3852c9126513defd69ce2445c61d2 to your computer and use it in GitHub Desktop.
A tasks.json file for compiling a simple C++ application in VS Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Been going through the Learn C++ tutorial (https://www.learncpp.com/), and so far this seems to be a pretty good setup for | |
tasks.json in VS Code. This tasks.json file is specific for clang++ (I'm on macOS 13.x), so you may need to update the `args` | |
to suit your own environment. In particular, you will want to replace with {your application name here} with whatever you want | |
your build artifact to be named. | |
*/ | |
{ | |
"tasks": [ | |
{ | |
"type": "cppbuild", | |
"label": "C/C++: clang++ build active file", | |
"command": "/usr/bin/clang++", | |
"args": [ | |
"-std=c++17", | |
"-Wall", | |
"-Wextra", | |
"-Weffc++", | |
"-Wconversion", | |
"-Werror", | |
"-pedantic-errors", | |
"-stdlib=libc++", | |
"-fcolor-diagnostics", | |
"-fansi-escape-codes", | |
"-g", | |
"${workspaceFolder}/*.cpp", | |
"-o", | |
"${workspaceFolder}/{your application name here}.exe" | |
], | |
"options": { | |
"cwd": "${workspaceFolder}" | |
}, | |
"problemMatcher": [ | |
"$gcc" | |
], | |
"group": { | |
"kind": "build", | |
"isDefault": true | |
}, | |
"detail": "Task generated by Debugger." | |
} | |
], | |
"version": "2.0.0" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment