Skip to content

Instantly share code, notes, and snippets.

@whoisryosuke
Created October 18, 2022 06:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whoisryosuke/dabddf557b10b65f7d1610279c73a5cd to your computer and use it in GitHub Desktop.
Save whoisryosuke/dabddf557b10b65f7d1610279c73a5cd to your computer and use it in GitHub Desktop.
C++ / CMake / VSCode - Tasks for building and testing (using ModernCppStarter). Swap out `GreeterTests` with your test file's name.
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "CMake: build",
"command": "cmake --build build/standalone",
"group": "build",
"problemMatcher": [],
"detail": "CMake build task"
},
{
"type": "shell",
"label": "CMake: build init",
"command": "cmake -S standalone -B build/standalone",
"group": "build",
"problemMatcher": [],
"detail": "CMake initialize build task"
},
{
"type": "shell",
"label": "CMake: test init",
"command": "cmake -S test -B build/test",
"group": "test",
"problemMatcher": [],
"detail": "CMake initialize test task"
},
{
"type": "shell",
"label": "CMake: test",
"command": "cmake --build build/test; ${workspaceFolder}/build/test/Debug/GreeterTests.exe",
"group": "test",
"problemMatcher": [],
"detail": "CMake build test task"
},
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment