From 53fb07ef5d94398223f0abcf8d6bc5d8785ac075 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 17 Sep 2009 17:16:43 -0400 Subject: 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. --- Modules/CheckCCompilerFlag.cmake | 1 + Modules/CheckCXXCompilerFlag.cmake | 1 + 2 files changed, 2 insertions(+) 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) -- cgit v0.12