add WindowsToolchain

This commit is contained in:
Bruno Alexandre Rosa 2026-03-23 18:39:56 -03:00
parent 1cfa23a6cd
commit 80e2ccc18b
4 changed files with 16 additions and 7 deletions

View file

@ -72,6 +72,18 @@ if(WIN32 OR USE_VCPKG)
endif()
endif()
if(WIN32
AND USE_VCPKG
AND CMAKE_GENERATOR STREQUAL "Ninja"
)
# vcpkg.cmake must be the primary toolchain; MSVC+Ninja toolchain is chainloaded
# See https://github.com/MarkSchofield/WindowsToolchain#windowstoolchain-and-vcpkg
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/WindowsToolchain/Windows.MSVC.toolchain.cmake"
CACHE FILEPATH "Chainloaded MSVC toolchain file for Ninja generator"
)
endif()
# A project name is needed for CPack
# Version can be overriden by git tags, see cmake/getversion.cmake
project("Cockatrice" VERSION 2.11.0)