summaryrefslogtreecommitdiffstats
path: root/Modules/Internal
diff options
context:
space:
mode:
authorMarc Aldorasi <marc@groundctl.com>2021-06-17 17:39:48 (GMT)
committerMarc Aldorasi <marc@groundctl.com>2021-06-17 17:39:48 (GMT)
commit701773f1da09568cc7501b97373fb1ad6b489a2b (patch)
treeaf19f137f9f937e3663710261508f0ae96f85dc8 /Modules/Internal
parentc92595be1d7c0ae3cd4ea8ff0ce27ede37f676e8 (diff)
downloadCMake-701773f1da09568cc7501b97373fb1ad6b489a2b.zip
CMake-701773f1da09568cc7501b97373fb1ad6b489a2b.tar.gz
CMake-701773f1da09568cc7501b97373fb1ad6b489a2b.tar.bz2
CheckCompilerFlag: Handle -Werror= for GCC 11
Diffstat (limited to 'Modules/Internal')
-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