summaryrefslogtreecommitdiff
path: root/Tests/RunCMake/try_compile
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:18 -0400
commiteab9ddb744256774bf430a4a8e90e23fb92fb331 (patch)
tree943e43150bb840b87862f1c086be8d4cf9fd9b82 /Tests/RunCMake/try_compile
parent5142effa37f34ef96724bba549034900a65d47fd (diff)
parent90287792b6dc9bc1535c0677f9b3d81d0bd28905 (diff)
downloadcmake-eab9ddb744256774bf430a4a8e90e23fb92fb331.tar.gz
Merge topic 'try_compile-CMP0128'
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/RunCMake/try_compile')
-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)