Skip to content

Commit

Permalink
Drop C++ standard tests for compilers which do not implement required…
Browse files Browse the repository at this point in the history
… features.

Signed-off-by: Richard Musil <[email protected]>
  • Loading branch information
Richard Musil committed Feb 1, 2025
1 parent 7974976 commit 350c400
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ include(test)
# override standard support
#############################################################################

# Clang only supports C++14 starting from Clang 3.5 (lesser versions miss std::enable_if_t)
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.5)
unset(compiler_supports_cpp_14)
endif()

# Clang only supports C++17 starting from Clang 5.0
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
unset(compiler_supports_cpp_17)
Expand All @@ -29,6 +34,10 @@ endif()
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.1)
unset(compiler_supports_cpp_17)
endif()
# GCC 5 and 6 do claim experimental support for C++17, but do not implement <optional>
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)
unset(compiler_supports_cpp_17)
endif()

# Clang C++20 support appears insufficient prior to Clang 9.0 (based on CI build failure)
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)
Expand Down

0 comments on commit 350c400

Please sign in to comment.