mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-11 08:20:18 -06:00
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.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user