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

@ -337,13 +337,6 @@ jobs:
with:
submodules: recursive
# Set relevant environment variables for MSVC, used to ensure ninja + MSVC build correctly together
- name: Setup MSVC (Windows)
if: matrix.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1.13.0
with:
arch: x64
- name: Setup ccache
if: matrix.use_ccache == 1 && matrix.os == 'macOS'
run: brew install ccache

3
.gitmodules vendored
View file

@ -4,3 +4,6 @@
[submodule "doxygen-awesome-css"]
path = doc/doxygen/theme
url = https://github.com/jothepro/doxygen-awesome-css.git
[submodule "cmake/WindowsToolchain"]
path = cmake/WindowsToolchain
url = https://github.com/MarkSchofield/WindowsToolchain.git

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)

@ -0,0 +1 @@
Subproject commit 4dc30a8bf484f41d5a16eec97b9284a52042e2b4