This Guide explains how to set up VSCode to allow building and testing of the SDK. This is not required for Game Server integration.
See the build guide for windows or build guide for linux for required build tools and compatible c++ compiler.
- C/C++ Extension Pack by Microsoft. Required (includes C++ Intellisense, CMake, CMake Tools)
- Clang-format by Xaver (optional alternative code formatter).
- C++ TestMate (Optional, for in-IDE test support).
In order to use CMake directly with
vscode
, see the [cmake tools]> (https://vector-of-bool.github.io/docs/vscode-cmake-tools/getting_started.html#cmake-tools-quick-start) online documentation.
Add the following keys to VSCode user settings or workspace settings (.vscode/settings.json).
{
"cmake.buildDirectory": "${workspaceFolder}/build",
"cmake.sourceDirectory": "${workspaceFolder}",
"editor.formatOnSave": true,
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
}
There are various options to configure and build the project with VSCode.
-
CMake: Select a kit
-
CMake: Clean (also reconfigures the project)
-
CMake: Build Target
If the bottom status bar does not show CMake Tools, right click on the status and select CMake Tools
- Select a kit/toolchain e.g. Visual Studio Build Tools 2019
- Select build variant (Debug / Release), this will configure the project
- Select a build target
- Choose Build
- Select a kit/toolchain (using one of the above methods)
- Select the CMake extension from the side bar.
- From the Project Outline, click the "..." button and choose: Clean Reconfigure All Projects
- From the Project Outline, choose the Build All Projects icon