summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-10-24 16:03:58 (GMT)
committerBrad King <brad.king@kitware.com>2022-10-24 16:04:57 (GMT)
commit90287792b6dc9bc1535c0677f9b3d81d0bd28905 (patch)
treeea3a28c00f109a1c8aafa739b419dcca0b48f0d4
parent50e90e282847f1109e5559d49fc12214b3493fff (diff)
downloadCMake-90287792b6dc9bc1535c0677f9b3d81d0bd28905.zip
CMake-90287792b6dc9bc1535c0677f9b3d81d0bd28905.tar.gz
CMake-90287792b6dc9bc1535c0677f9b3d81d0bd28905.tar.bz2
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.
-rw-r--r--Tests/RunCMake/try_compile/RunCMakeTest.cmake9
1 files changed, 5 insertions, 4 deletions
diff --git a/Tests/RunCMake/try_compile/RunCMakeTest.cmake b/Tests/RunCMake/try_compile/RunCMakeTest.cmake
index 4301cf7..33d6543 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)