This repository provides a template for a GitHub-based CMake project which supports building & debugging using Visual Studio on both Windows and Linux
- Setup WSL subsystem: https://learn.microsoft.com/en-us/windows/wsl/install
- Install required packages on WSL:
sudo apt-get install gcc g++ gdb cmake
- Clone this repository
- Open the cloned repository as "directory" in Visual Studio (as opposed to "open solution")
- Open Visual Studio settings, find CMake section, set following option:
- Select target machine, configuration and target:
- Press "Debug" and enjoy seamless debugging of a Linux binary in Visual Studio
- Linux: Launch sanitizers.exe executable with different
sanitize
configurations - Linux: Put a breakpoint in helloworld.cpp and run it
- Windows: Run/debug tests with
x64 sanitize=address
config