From 5f12f8c1de66679bd8ed88d72757aef01bf78b41 Mon Sep 17 00:00:00 2001 From: Richard Musil Date: Sat, 1 Feb 2025 19:21:18 +0100 Subject: [PATCH] Drop C++ standard tests for MSVC versions which do not implement required features. Signed-off-by: Richard Musil --- .github/external_ci/appveyor.yml | 4 ++-- tests/CMakeLists.txt | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/external_ci/appveyor.yml b/.github/external_ci/appveyor.yml index 126ed99b3..5c6b47a34 100644 --- a/.github/external_ci/appveyor.yml +++ b/.github/external_ci/appveyor.yml @@ -41,7 +41,7 @@ environment: - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 configuration: Release platform: x86 - CXX_FLAGS: "/permissive- /std:c++latest /utf-8 /W4 /WX" + CXX_FLAGS: "/permissive- /std:c++17 /utf-8 /W4 /WX" CMAKE_OPTIONS: "" GENERATOR: Visual Studio 15 2017 @@ -62,7 +62,7 @@ environment: - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 configuration: Release platform: x64 - CXX_FLAGS: "/permissive- /std:c++latest /Zc:__cplusplus /utf-8 /W4 /WX" + CXX_FLAGS: "/permissive- /std:c++17 /Zc:__cplusplus /utf-8 /W4 /WX" CMAKE_OPTIONS: "" GENERATOR: Visual Studio 15 2017 diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 51342e51c..b1dc5df10 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -31,7 +31,7 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSIO unset(compiler_supports_cpp_17) endif() # MSVC 2015 (14.0) does not support C++17 -if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.1) +if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.10) unset(compiler_supports_cpp_17) endif() # GCC 5 and 6 do claim experimental support for C++17, but do not implement @@ -43,6 +43,10 @@ endif() if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0) unset(compiler_supports_cpp_20) endif() +# MSVC 2017 (15.x) does not support C++20 +if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.20) + unset(compiler_supports_cpp_20) +endif() # GCC started supporting C++20 features in 8.0 but a test for #3070 segfaults prior to 9.0 if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0) unset(compiler_supports_cpp_20)