Skip to content

Instantly share code, notes, and snippets.

@StefanoLusardi
Created November 1, 2023 21:02
Show Gist options
  • Select an option

  • Save StefanoLusardi/55c331ca580d38ae942e4c68ab976f1f to your computer and use it in GitHub Desktop.

Select an option

Save StefanoLusardi/55c331ca580d38ae942e4c68ab976f1f to your computer and use it in GitHub Desktop.
Windows C++ / CMake build
:: Execute only one of the following scripts:
"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\Tools\vsdevcmd.bat" -arch amd64 -host_arch amd64
"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
set CC=clang
set CXX=clang++
cmake -D CMAKE_BUILD_TYPE=Debug -G Ninja -B build/clang -S .
cmake --build build/clang
set CC=clang-cl
set CXX=clang-cl
cmake -D CMAKE_BUILD_TYPE=Debug -G Ninja -B build/clang-cl -S .
cmake --build build/clang-cl
set CC=cl
set CXX=cl
cmake -D CMAKE_BUILD_TYPE=Debug -G Ninja -B build/msvc -S .
cmake --build build/msvc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment