summaryrefslogtreecommitdiff
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-10-25 18:26:00 +0000
committerKitware Robot <kwrobot@kitware.com>2022-10-25 14:26:17 -0400
commit883798edc4ce4c46ab88f40faa68d4c81c7fa8af (patch)
treed41984e74a7513da217b9f0cccabadd593aa0d0b /Tests
parent19f49a7514797bc27b37482701a8d81c2ea57854 (diff)
parent90287792b6dc9bc1535c0677f9b3d81d0bd28905 (diff)
downloadcmake-883798edc4ce4c46ab88f40faa68d4c81c7fa8af.tar.gz
Merge topic 'try_compile-CMP0128' into release-3.25
90287792b6 Tests: Avoid running C++11 test on GNU < 4.7 Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7821
Diffstat (limited to 'Tests')
-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 a3a3451baf..724547126a 100644
--- a/Tests/RunCMake/try_compile/RunCMakeTest.cmake
+++ b/Tests/RunCMake/try_compile/RunCMakeTest.cmake
@@ -95,10 +95,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)