From 90287792b6dc9bc1535c0677f9b3d81d0bd28905 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 24 Oct 2022 12:03:58 -0400 Subject: 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. --- Tests/RunCMake/try_compile/RunCMakeTest.cmake | 9 +++++---- 1 file 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) -- cgit v0.12