Skip to content

Commit

Permalink
Configure, build, and test with MSVC 17.10
Browse files Browse the repository at this point in the history
  • Loading branch information
demianmnave committed Nov 19, 2024
1 parent 98ed95a commit d64d339
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 58 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# SPDX short identifier: BSL-1.0

name: ninja-msvc17
name: msvc17
on: push

jobs:
job:
name: MSVC 17.10, CMake 3.27
name: MSVC 17.10
runs-on: windows-2022
steps:
- name: Install MSVC 17.10
Expand All @@ -21,16 +21,14 @@ jobs:
'modify', '--installPath', "`"$vspath`"", '--quiet', '--norestart', '--nocache', '--noUpdateInstaller', `
'--add', 'Microsoft.VisualStudio.Component.VC.14.40.17.10.x86.x64'
- name: Pull cmake 3.27
uses: lukka/get-cmake@latest
- uses: lukka/get-cmake@latest
with:
cmakeVersion: "~3.27.0"
useCloudCache: true

- name: Checkout CML
uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Build and test with MSVC 17.10
- name: CMake configure-build-test
uses: lukka/run-cmake@v10
with:
configurePreset: "cml-ci-msvc17-mt-s",
Expand Down
147 changes: 98 additions & 49 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,6 @@
// Core configuration presets:
"version": 7,
"configurePresets": [
{
// Standard build directory, and always target x64:
"name": ".cml-configure-defaults",
"hidden": true,
"binaryDir": "${sourceDir}/.build/${presetName}",
"architecture": {
"value": "x64",
"strategy": "external"
},
"cacheVariables": {
"BUILD_SHARED_LIBS": {
"type": "BOOL",
"value": false
},
"BUILD_STATIC_RUNTIME": {
"type": "BOOL",
"value": true
}
}
},
{
// Inheritable preset to enable testing:
"name": ".cml-configure-testing",
"hidden": true,
"cacheVariables": {
"BUILD_TESTING": {
"type": "BOOL",
"value": true
}
}
},

{
// Inheritable conditional to enable a configuration preset on Windows only:
"name": ".cml-windows-only",
Expand Down Expand Up @@ -80,21 +48,49 @@
}
},


{
// Inheritable configuration to use ClangCL and the Ninja generator:
"name": ".cml-ninja-clangcl",
// Standard build directory, and always target x64:
"name": ".cml-configure-defaults",
"hidden": true,
"binaryDir": "${sourceDir}/.build/${presetName}",
"architecture": {
"value": "x64",
"strategy": "external"
},
"cacheVariables": {
"BUILD_SHARED_LIBS": {
"type": "BOOL",
"value": false
},
"BUILD_STATIC_RUNTIME": {
"type": "BOOL",
"value": true
},
"BUILD_TESTING": {
"type": "BOOL",
"value": true
}
}
},

{
// Inheritable configuration to use the system default MSVC ClangCL and the Ninja generator:
"name": ".cml-ninja-msvc-clangcl",
"hidden": true,
"generator": "Ninja",
"inherits": [ ".cml-windows-only" ],
"generator": "Ninja Multi-Config",
"cacheVariables": {
"CMAKE_C_COMPILER": "clang-cl.exe",
"CMAKE_CXX_COMPILER": "clang-cl.exe"
}
},
{
// Inheritable configuration to use MSVC and the Ninja generator:
// Inheritable configuration to use the system default MSVC and the Ninja generator:
"name": ".cml-ninja-msvc",
"hidden": true,
"generator": "Ninja",
"inherits": [ ".cml-windows-only" ],
"generator": "Ninja Multi-Config",
"cacheVariables": {
"CMAKE_C_COMPILER": "cl.exe",
"CMAKE_CXX_COMPILER": "cl.exe"
Expand All @@ -108,7 +104,7 @@
"generator": "Visual Studio 17 2022"
},
{
// Inheritable configuration to use MSVC17+ClangCL and MSBuild:
// Inheritable configuration to use the system default MSVC17 with ClangCL and MSBuild:
"name": ".cml-msvc17-clangcl",
"hidden": true,
"inherits": [ ".cml-windows-only" ],
Expand All @@ -117,27 +113,30 @@
},

{
// Preset to configure a static dev-test (IDE) build with MSVC17:
// Preset to configure a static dev-test (IDE) build with the system default MSVC17:
"name": "cml-dev-msvc17-mt-s",
"inherits": [ ".cml-configure-defaults", ".cml-msvc17", ".cml-configure-testing" ]
"inherits": [ ".cml-configure-defaults", ".cml-msvc17" ]
},

{
// Preset to configure a static dev-test build (IDE) with MSVC17+ClangCL:
// Preset to configure a static dev-test build (IDE) with the system default MSVC17 ClangCL:
"name": "cml-dev-msvc17-clangcl-mt-s",
"inherits": [ ".cml-configure-defaults", ".cml-msvc17-clangcl", ".cml-configure-testing" ]
"inherits": [ ".cml-configure-defaults", ".cml-msvc17-clangcl" ]
},

{
// Preset to configure a CI test build with Ninja+ClangCL:
"name": "cml-ci-ninja-clangcl-mt-s",
"inherits": [ ".cml-configure-defaults", ".cml-ninja-clangcl", ".cml-configure-testing" ]
// Preset to configure a CI test build with Ninja Multi-Config and the system default MSVC ClangCL:
"name": "cml-ci-ninja-msvc-clangcl-mt-s",
"inherits": [ ".cml-configure-defaults", ".cml-ninja-msvc-clangcl" ]
},

{
// Preset to configure a CI test build with Ninja+MSVC:
// Preset to configure a CI test build with Ninja Multi-Config and the system default MSVC:
"name": "cml-ci-ninja-msvc-mt-s",
"inherits": [ ".cml-configure-defaults", ".cml-ninja-msvc", ".cml-configure-testing" ]
"inherits": [ ".cml-configure-defaults", ".cml-ninja-msvc" ]
},
{
// Preset to configure a CI test build with MSVC17:
"name": "cml-ci-msvc17-mt-s",
"inherits": [ ".cml-configure-defaults", ".cml-msvc17" ]
}
],

Expand Down Expand Up @@ -186,6 +185,56 @@
}
]
}
},

{
// Static Ninja+ClangCl release build:
"name": "cml-ci-ninja-msvc-clangcl-mt-s-release",
"inherits": [ ".cml-windows-build-only" ],
"configurePreset": "cml-ci-ninja-msvc-clangcl-mt-s",
"inheritConfigureEnvironment": true,
"configuration": "Release"
},
{
// Static MSVC release build:
"name": "cml-ci-msvc17-mt-s-release",
"inherits": [ ".cml-windows-build-only" ],
"configurePreset": "cml-ci-msvc17-mt-s",
"inheritConfigureEnvironment": true,
"configuration": "Release"
}
],

"testPresets": [
{
// Inheritable conditional to enable a test preset on Windows only:
"name": ".cml-windows-test-only",
"hidden": true,
"condition": {
"type": "allOf",
"conditions": [
{
"lhs": "${hostSystemName}",
"type": "equals",
"rhs": "Windows"
}
]
}
},

{
"name": "cml-ci-ninja-msvc-clangcl-mt-s-release-test",
"inherits": [ ".cml-windows-test-only" ],
"configurePreset": "cml-ci-ninja-msvc-clangcl-mt-s",
"inheritConfigureEnvironment": true,
"configuration": "Release"
},
{
"name": "cml-ci-msvc17-mt-s-release-test",
"inherits": [ ".cml-windows-test-only" ],
"configurePreset": "cml-ci-msvc17-mt-s",
"inheritConfigureEnvironment": true,
"configuration": "Release"
}
]
}
2 changes: 1 addition & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ function(cml_add_test _name)
if(MSVC)
set(_msvc_common_options
/permissive-
/MP
/EHsc
/W4 # Enable strict warnings.
)
Expand All @@ -36,6 +35,7 @@ function(cml_add_test _name)
/Zc:rvalueCast
/diagnostics:caret
/WL
/MP
)

set(_msvc_link_options
Expand Down
3 changes: 2 additions & 1 deletion tests/vector/vector_temporary1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@
CATCH_TEST_CASE("const_temporary1")
{
using const_type = cml::temporary_of_t<const cml::vector3d>;
}
CATCH_CHECK(std::is_same_v<const_type, cml::vector3d>);
}

0 comments on commit d64d339

Please sign in to comment.