summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CheckCompilerFlag
diff options
context:
space:
mode:
authorLuthaf <luthaf@luthaf.fr>2020-10-05 21:28:46 (GMT)
committerBrad King <brad.king@kitware.com>2020-10-06 14:38:18 (GMT)
commitd66858c8e42c8a07a8bbc15559c21eb917866f46 (patch)
tree82a596626a0aa91a17b3f48ed53a5a85210a8daa /Tests/RunCMake/CheckCompilerFlag
parent7f031e11308d8a3b6b74c019788d9e7724c52064 (diff)
downloadCMake-d66858c8e42c8a07a8bbc15559c21eb917866f46.zip
CMake-d66858c8e42c8a07a8bbc15559c21eb917866f46.tar.gz
CMake-d66858c8e42c8a07a8bbc15559c21eb917866f46.tar.bz2
CheckCompilerFlag: Update the regex used to detect invalid options for GCC 10
The warning emmitted by GCC for invalid options have been updated to read "command-line option XXX is valid ..." instead of "command line option XXX is valid ...". Update the regex to make it valid with both the old and new warning message. Fixes: #21275
Diffstat (limited to 'Tests/RunCMake/CheckCompilerFlag')
-rw-r--r--Tests/RunCMake/CheckCompilerFlag/CheckCCompilerFlag.cmake7
1 files changed, 7 insertions, 0 deletions
diff --git a/Tests/RunCMake/CheckCompilerFlag/CheckCCompilerFlag.cmake b/Tests/RunCMake/CheckCompilerFlag/CheckCCompilerFlag.cmake
index d268ed2..095fd54 100644
--- a/Tests/RunCMake/CheckCompilerFlag/CheckCCompilerFlag.cmake
+++ b/Tests/RunCMake/CheckCompilerFlag/CheckCCompilerFlag.cmake
@@ -13,3 +13,10 @@ if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang" AND NOT "x${CMAKE_C_SIMULATE_ID}" STR
message(SEND_ERROR "${CMAKE_C_COMPILER_ID} compiler flag '-x c' check failed")
endif()
endif()
+
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
+ check_compiler_flag(C "-frtti" SHOULD_FAIL_RTTI)
+ if(SHOULD_FAIL_RTTI)
+ message(SEND_ERROR "${CMAKE_C_COMPILER_ID} compiler flag '-frtti' check passed but should have failed")
+ endif()
+endif()