summaryrefslogtreecommitdiffstats
path: root/Modules/CheckCXXCompilerFlag.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2011-08-08 16:53:17 (GMT)
committerBrad King <brad.king@kitware.com>2011-08-08 16:53:17 (GMT)
commited6be501de960a21fc756d08e9a0a2318f276307 (patch)
treeefe016c3eb92719e2b1cc04846065c7b656e41ff /Modules/CheckCXXCompilerFlag.cmake
parent0e28009184cdb3ff375bc49142726afaa001ddeb (diff)
downloadCMake-ed6be501de960a21fc756d08e9a0a2318f276307.zip
CMake-ed6be501de960a21fc756d08e9a0a2318f276307.tar.gz
CMake-ed6be501de960a21fc756d08e9a0a2318f276307.tar.bz2
Fix CHECK_(C|CXX)_COMPILER_FLAG for Clang (#12394)
This compiler warns and returns 0 for unrecognized flags. We fix the compiler flag check macros by looking for a warning in the output.
Diffstat (limited to 'Modules/CheckCXXCompilerFlag.cmake')
-rw-r--r--Modules/CheckCXXCompilerFlag.cmake1
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/CheckCXXCompilerFlag.cmake b/Modules/CheckCXXCompilerFlag.cmake
index 788bf35..f646e78 100644
--- a/Modules/CheckCXXCompilerFlag.cmake
+++ b/Modules/CheckCXXCompilerFlag.cmake
@@ -28,6 +28,7 @@ MACRO (CHECK_CXX_COMPILER_FLAG _FLAG _RESULT)
CHECK_CXX_SOURCE_COMPILES("int main() { return 0;}" ${_RESULT}
# Some compilers do not fail with a bad flag
FAIL_REGEX "unrecognized .*option" # GNU
+ FAIL_REGEX "unknown .*option" # Clang
FAIL_REGEX "ignoring unknown option" # MSVC
FAIL_REGEX "warning D9002" # MSVC, any lang
FAIL_REGEX "[Uu]nknown option" # HP