Skip to content

VSCode Setup

WSAL Evan edited this page Nov 19, 2024 · 1 revision
  1. In the terminal, run these commands:
mkdir build
cd build
cmake ..
cd ..
  1. Next, set up launch.json and tasks.json.

Recommended setup for Windows:

launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "C++ Launch (VS Windows)",
            "type": "cppvsdbg",
            "request": "launch",
            "program": "${workspaceFolder}/build/bin/Debug/WVTest.exe",
            "symbolSearchPath": "${workspaceFolder}/build/bin/Debug",
            "console": "externalTerminal",
            "logging": {
                "moduleLoad": true,
                "trace": true
            },
            "cwd": "${workspaceFolder}/build/bin/Debug",
            "preLaunchTask": "Build Debug"
        }
    ]
}

tasks.json

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Build Debug",
            "type": "shell",
            "command": "cmake",
            "args": [
                "--build",
                "${workspaceFolder}/build",
                "--config",
                "Debug"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "problemMatcher": [],
            "detail": "Generated build task for CMake."
        }
    ]
}

With both of these, you will be able to press F5 (or launch from the Run and Debug menu) and it will rebuild and run the project. Make sure the C++ Launch (VS Windows) configuration is selected in the Run and Debug menu.

Clone this wiki locally