summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-09-17 21:16:43 (GMT)
committerBrad King <brad.king@kitware.com>2009-09-17 21:16:43 (GMT)
commit53fb07ef5d94398223f0abcf8d6bc5d8785ac075 (patch)
tree08c4bd3576fffb9cb820fa2068a39394937f149a /Modules
parent6362d4c7439edfc7340acf53207ef759c1e2aeb1 (diff)
downloadCMake-53fb07ef5d94398223f0abcf8d6bc5d8785ac075.zip
CMake-53fb07ef5d94398223f0abcf8d6bc5d8785ac075.tar.gz
CMake-53fb07ef5d94398223f0abcf8d6bc5d8785ac075.tar.bz2
Fix CHECK_(C|CXX)_COMPILER_FLAG for HP
This compiler warns and returns 0 for unrecognized flags. We fix the compiler flag check macros by looking for a warning in the output. See issue #9516.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CheckCCompilerFlag.cmake1
-rw-r--r--Modules/CheckCXXCompilerFlag.cmake1
2 files changed, 2 insertions, 0 deletions
diff --git a/Modules/CheckCCompilerFlag.cmake b/Modules/CheckCCompilerFlag.cmake
index b4289e4..858ea2a 100644
--- a/Modules/CheckCCompilerFlag.cmake
+++ b/Modules/CheckCCompilerFlag.cmake
@@ -21,6 +21,7 @@ MACRO (CHECK_C_COMPILER_FLAG _FLAG _RESULT)
# Some compilers do not fail with a bad flag
FAIL_REGEX "unrecognized option" # GNU
FAIL_REGEX "ignoring unknown option" # MSVC
+ FAIL_REGEX "[Uu]nknown option" # HP
)
SET (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}")
ENDMACRO (CHECK_C_COMPILER_FLAG)
diff --git a/Modules/CheckCXXCompilerFlag.cmake b/Modules/CheckCXXCompilerFlag.cmake
index e883282..018eacd 100644
--- a/Modules/CheckCXXCompilerFlag.cmake
+++ b/Modules/CheckCXXCompilerFlag.cmake
@@ -21,6 +21,7 @@ MACRO (CHECK_CXX_COMPILER_FLAG _FLAG _RESULT)
# Some compilers do not fail with a bad flag
FAIL_REGEX "unrecognized option" # GNU
FAIL_REGEX "ignoring unknown option" # MSVC
+ FAIL_REGEX "[Uu]nknown option" # HP
)
SET (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}")
ENDMACRO (CHECK_CXX_COMPILER_FLAG)