Skip to content

Commit

Permalink
Fix Windows workflow preset
Browse files Browse the repository at this point in the history
Use CMAKE_TOOLCHAIN_FILE for ctest too

Checkout with submodules recursive strategy
  • Loading branch information
ClausKlein committed Oct 15, 2024
1 parent efd8fd0 commit 4b94163
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 14 deletions.
10 changes: 3 additions & 7 deletions .CMakeUserPresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"inherits": [
"dev-mode"
],
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": {
"CMAKE_EXPORT_COMPILE_COMMANDS": true,
Expand Down Expand Up @@ -44,7 +43,7 @@
}
},
{
"name": "dev-win64",
"name": "dev-Windows",
"inherits": [
"dev-common",
"cppcheck",
Expand All @@ -57,23 +56,20 @@
},
{
"name": "dev",
"generator": "Ninja",
"inherits": "dev-<hostSystemName>"
},
{
"name": "dev-coverage",
"generator": "Ninja",
"inherits": [
"ci-coverage",
"dev-<hostSystemName>"
"dev-Linux"
]
},
{
"name": "dev-sanitize",
"generator": "Ninja",
"inherits": [
"ci-sanitize",
"dev-<hostSystemName>"
"dev-Linux"
]
}
],
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ jobs:
os: [macos-15, ubuntu-24.04, windows-2022]
include:
- { os: macos-15, uname: Darwin }
- { os: ubuntu-22.04, uname: Linux }
- { os: ubuntu-24.04, uname: Linux }
- { os: windows-2022, uname: Windows }

# type: [shared, static]
Expand All @@ -167,6 +167,8 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Python
if: matrix.os != 'macos-15'
Expand Down
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,10 @@ if(PROJECT_IS_TOP_LEVEL)
# --build-generator ${CMAKE_GENERATOR}
# --build-makeprogram ${CMAKE_MAKE_PROGRAM}
# --build-options
# "-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}"
# "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
# "-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}"
# "-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}"
# "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}"
# )
# cmake-format: on
endif()
Expand Down
9 changes: 5 additions & 4 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
},
{
"name": "flags-windows",
"description": "Note that all the flags after /W4 are required for MSVC to conform to the language standard",
"description": "NOTE: that all the flags after /W4 are required for MSVC to conform to the language standard",
"hidden": true,
"cacheVariables": {
"CMAKE_CXX_FLAGS": "/sdl /guard:cf /utf-8 /diagnostics:caret /w14165 /w44242 /w44254 /w44263 /w34265 /w34287 /w44296 /w44365 /w44388 /w44464 /w14545 /w14546 /w14547 /w14549 /w14555 /w34619 /w34640 /w24826 /w14905 /w14906 /w14928 /w45038 /W4 /permissive- /volatile:iso /Zc:inline /Zc:preprocessor /Zc:enumTypes /Zc:lambda /Zc:__cplusplus /Zc:externConstexpr /Zc:throwingNew /EHsc",
Expand Down Expand Up @@ -141,14 +141,15 @@
"inherits": [
"ci-std"
],
"toolchainFile": "cmake/WindowsToolchain/Windows.MSVC.toolchain.cmake",
"generator": "Ninja Multi-Config",
"description": "This build is only available on Windows",
"hidden": true,
"architecture": "x64",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_SYSTEM_PROCESSOR": "AMD64"
"CMAKE_C_COMPILER": "cl",
"CMAKE_CXX_COMPILER": "cl",
"CMAKE_SYSTEM_PROCESSOR": "AMD64",
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/cmake/WindowsToolchain/Windows.MSVC.toolchain.cmake"
},
"condition": {
"type": "equals",
Expand Down
3 changes: 2 additions & 1 deletion example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ if(NOT PROJECT_IS_TOP_LEVEL)
--build-generator ${CMAKE_GENERATOR}
--build-makeprogram ${CMAKE_MAKE_PROGRAM}
--build-options
"-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}"
"-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
"-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}"
"-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}"
"-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}"
)
# cmake-format: on
endif()
Expand Down

0 comments on commit 4b94163

Please sign in to comment.