Using VS Code on Windows
Last updated: 2022-02-20
- Download MSYS2 from https://www.msys2.org/ and follow the installation instructions there.
- Execute the following command in a MSYS2 Shell to install git:
pacman -S git
- add
C:\msys64\mingw64\bin
to PATH - Download and install VS Code from here if you haven't already
- Install the extensions
ms-vscode.cpptools
andms-vscode.cmake-tools
- Clone the repository by
git clone --recurse-submodules -j8 https://github.com/bb1950328/BrickSim.git
- Run
setup_workspace.sh
- Open the BrickSim folder in VS Code. you should get the notifications like in the following screenshot (at least the first one):
click "yes" on the first notification, we'll deal with the second one later. - Now it's time to adjust some settings:
- Press Ctrl + Shift+ P and type "preferences: Open Settings (JSON)"
Hit Enter or click the first result. - add the following text:Maybe you already have some settings here so make sure they don't contradict each other.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
{ "cmake.configureOnOpen": true, "cmake.cmakePath": "C:\\msys64\\mingw64\\bin\\cmake.exe", "cmake.generator": "MinGW Makefiles", "cmake.buildDirectory": "${workspaceFolder}/cmake-build", "cmake.mingwSearchDirs": [ "C:\\msys64\\mingw64\\bin" ], "cmake.debugConfig": { "cwd": "${workspaceFolder}" }, "terminal.integrated.shell.windows": "C:\\msys64\\usr\\bin\\bash.exe", "terminal.integrated.shellArgs.windows": ["-li"], "terminal.integrated.env.windows": { "MSYSTEM": "MINGW64", "CHERE_INVOKING": "1", }, }
- Save the
settings.json
file. - Now press Ctrl+Shift+P and type "CMake: Edit User-Local CMake Kits"
- Insert the following code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
[ { "name": "Mingw64 GCC", "compilers": { "C": "C:\\msys64\\mingw64\\bin\\gcc.exe", "CXX": "C:\\msys64\\mingw64\\bin\\g++.exe" }, "preferredGenerator": { "name": "MinGW Makefiles", "platform": "x64" }, "environmentVariables": { "PATH": "C:/msys64/mingw64/bin/" } } ]
- Save the
cmake-tools-kits.json
file.
- Press Ctrl + Shift+ P and type "preferences: Open Settings (JSON)"
- Download git for windows from here and install it if you want git integration in VS Code.
- Restart VS Code
- You should now be able to launch the application using the bottom status bar: