diff options
author | Luthaf <luthaf@luthaf.fr> | 2020-10-05 21:28:46 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-10-06 14:38:18 (GMT) |
commit | d66858c8e42c8a07a8bbc15559c21eb917866f46 (patch) | |
tree | 82a596626a0aa91a17b3f48ed53a5a85210a8daa /Modules | |
parent | 7f031e11308d8a3b6b74c019788d9e7724c52064 (diff) | |
download | CMake-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 'Modules')
-rw-r--r-- | Modules/CheckCompilerFlag.cmake | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Modules/CheckCompilerFlag.cmake b/Modules/CheckCompilerFlag.cmake index 9223009..0339225 100644 --- a/Modules/CheckCompilerFlag.cmake +++ b/Modules/CheckCompilerFlag.cmake @@ -45,20 +45,20 @@ function(CHECK_COMPILER_FLAG _lang _flag _var) if(_lang STREQUAL C) set(_lang_src "int main(void) { return 0; }") - set(_lang_fail_regex FAIL_REGEX "command line option .* is valid for .* but not for C") + set(_lang_fail_regex FAIL_REGEX "command[ -]line option .* is valid for .* but not for C") elseif(_lang STREQUAL CXX) set(_lang_src "int main() { return 0; }") - set(_lang_fail_regex FAIL_REGEX "command line option .* is valid for .* but not for C\\+\\+") + set(_lang_fail_regex FAIL_REGEX "command[ -]line option .* is valid for .* but not for C\\+\\+") elseif(_lang STREQUAL Fortran) set(_lang_src " program test\n stop\n end program") - set(_lang_fail_regex FAIL_REGEX "command line option .* is valid for .* but not for Fortran") + set(_lang_fail_regex FAIL_REGEX "command[ -]line option .* is valid for .* but not for Fortran") elseif(_lang STREQUAL OBJC) set(_lang_src [=[ #ifndef __OBJC__ # error "Not an Objective-C compiler" #endif int main(void) { return 0; }]=]) - set(_lang_fail_regex FAIL_REGEX "command line option .* is valid for .* but not for Objective-C" # GNU + set(_lang_fail_regex FAIL_REGEX "command[ -]line option .* is valid for .* but not for Objective-C" # GNU FAIL_REGEX "argument unused during compilation: .*") # Clang elseif(_lang STREQUAL OBJCXX) set(_lang_src [=[ @@ -66,7 +66,7 @@ int main(void) { return 0; }]=]) # error "Not an Objective-C++ compiler" #endif int main(void) { return 0; }]=]) - set(_lang_fail_regex FAIL_REGEX "command line option .* is valid for .* but not for Objective-C\\+\\+" # GNU + set(_lang_fail_regex FAIL_REGEX "command[ -]line option .* is valid for .* but not for Objective-C\\+\\+" # GNU FAIL_REGEX "argument unused during compilation: .*") # Clang else() message (SEND_ERROR "check_compiler_flag: ${_lang}: unknown language.") |