diff options
author | Brad King <brad.king@kitware.com> | 2022-10-24 12:03:58 -0400 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-10-24 12:04:57 -0400 |
commit | 90287792b6dc9bc1535c0677f9b3d81d0bd28905 (patch) | |
tree | ea3a28c00f109a1c8aafa739b419dcca0b48f0d4 /Tests | |
parent | 50e90e282847f1109e5559d49fc12214b3493fff (diff) | |
download | cmake-90287792b6dc9bc1535c0677f9b3d81d0bd28905.tar.gz |
Tests: Avoid running C++11 test on GNU < 4.7
The test added in commit 50e90e2828 (try_compile: Honor CMP0128 setting
in test project, 2022-10-18, v3.25.0-rc2~4^2) requires that the compiler
support C++11 mode, so do not run it on GNU compilers that are too old.
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/try_compile/RunCMakeTest.cmake | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Tests/RunCMake/try_compile/RunCMakeTest.cmake b/Tests/RunCMake/try_compile/RunCMakeTest.cmake index 4301cf7ee3..33d6543129 100644 --- a/Tests/RunCMake/try_compile/RunCMakeTest.cmake +++ b/Tests/RunCMake/try_compile/RunCMakeTest.cmake @@ -121,10 +121,11 @@ run_cmake(Inspect) include("${RunCMake_BINARY_DIR}/Inspect-build/info.cmake") # FIXME: Support more compilers and default standard levels. -if (CMAKE_CXX_COMPILER_ID MATCHES "^(GNU|AppleClang)$" - AND DEFINED CMAKE_CXX_STANDARD_DEFAULT - AND DEFINED CMAKE_CXX_EXTENSIONS_DEFAULT - ) +if (DEFINED CMAKE_CXX_STANDARD_DEFAULT AND + DEFINED CMAKE_CXX_EXTENSIONS_DEFAULT AND ( + (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 4.7) OR + (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") + )) run_cmake(CMP0128-WARN) if(NOT CMAKE_CXX_STANDARD_DEFAULT EQUAL 11) run_cmake(CMP0128-NEW) |