summaryrefslogtreecommitdiff
path: root/Tests
diff options
context:
space:
mode:
authorLuthaf <luthaf@luthaf.fr>2020-10-05 23:28:46 +0200
committerBrad King <brad.king@kitware.com>2020-10-06 10:38:18 -0400
commitd66858c8e42c8a07a8bbc15559c21eb917866f46 (patch)
tree82a596626a0aa91a17b3f48ed53a5a85210a8daa /Tests
parent7f031e11308d8a3b6b74c019788d9e7724c52064 (diff)
downloadcmake-d66858c8e42c8a07a8bbc15559c21eb917866f46.tar.gz
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')
-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 d268ed2a3a..095fd54456 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()