summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-06-18 13:36:54 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-06-18 13:37:08 (GMT)
commitefc3e25790354383eca1e06c65ca71a7e093abb5 (patch)
treec11133e482414fa18f02ce3c1343f9255ef5fe7e
parent22fb0713a25ac4ecfbbc1e1c24f440ba83a175b8 (diff)
parent701773f1da09568cc7501b97373fb1ad6b489a2b (diff)
downloadCMake-efc3e25790354383eca1e06c65ca71a7e093abb5.zip
CMake-efc3e25790354383eca1e06c65ca71a7e093abb5.tar.gz
CMake-efc3e25790354383eca1e06c65ca71a7e093abb5.tar.bz2
Merge topic 'gcc11-errors' into release-3.21
701773f1da CheckCompilerFlag: Handle -Werror= for GCC 11 Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Ben Boeckel <ben.boeckel@kitware.com> Merge-request: !6242
-rw-r--r--Modules/Internal/CheckCompilerFlag.cmake6
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/Internal/CheckCompilerFlag.cmake b/Modules/Internal/CheckCompilerFlag.cmake
index 9eb1bf0..693e28b 100644
--- a/Modules/Internal/CheckCompilerFlag.cmake
+++ b/Modules/Internal/CheckCompilerFlag.cmake
@@ -13,10 +13,12 @@ function(CMAKE_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"
+ FAIL_REGEX "-Werror=.* argument .* is not valid 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\\+\\+"
+ FAIL_REGEX "-Werror=.* argument .* is not valid for C\\+\\+")
elseif(_lang STREQUAL "CUDA")
set(_lang_src "__host__ int main() { return 0; }")
set(_lang_fail_regex FAIL_REGEX "command[ -]line option .* is valid for .* but not for C\\+\\+" # Host GNU