diff --git a/.github/workflows/ninja-msvc17.yml b/.github/workflows/msvc17.yml similarity index 82% rename from .github/workflows/ninja-msvc17.yml rename to .github/workflows/msvc17.yml index 447e588..93a01b3 100644 --- a/.github/workflows/ninja-msvc17.yml +++ b/.github/workflows/msvc17.yml @@ -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 @@ -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", diff --git a/CMakePresets.json b/CMakePresets.json index 80ed5d8..50f3bc1 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -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", @@ -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" @@ -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" ], @@ -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" ] } ], @@ -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" } ] } \ No newline at end of file diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 823599e..fa53c21 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -22,7 +22,6 @@ function(cml_add_test _name) if(MSVC) set(_msvc_common_options /permissive- - /MP /EHsc /W4 # Enable strict warnings. ) @@ -36,6 +35,7 @@ function(cml_add_test _name) /Zc:rvalueCast /diagnostics:caret /WL + /MP ) set(_msvc_link_options diff --git a/tests/vector/vector_temporary1.cpp b/tests/vector/vector_temporary1.cpp index cc3bc61..43ae013 100644 --- a/tests/vector/vector_temporary1.cpp +++ b/tests/vector/vector_temporary1.cpp @@ -15,4 +15,5 @@ CATCH_TEST_CASE("const_temporary1") { using const_type = cml::temporary_of_t; -} + CATCH_CHECK(std::is_same_v); +} \ No newline at end of file