diff --git a/Modules/CheckCCompilerFlag.cmake b/Modules/CheckCCompilerFlag.cmake index 858ea2afc..cbde10c00 100644 --- a/Modules/CheckCCompilerFlag.cmake +++ b/Modules/CheckCCompilerFlag.cmake @@ -19,9 +19,11 @@ MACRO (CHECK_C_COMPILER_FLAG _FLAG _RESULT) SET(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}") CHECK_C_SOURCE_COMPILES("int main() { return 0;}" ${_RESULT} # Some compilers do not fail with a bad flag - FAIL_REGEX "unrecognized option" # GNU + FAIL_REGEX "unrecognized .*option" # GNU FAIL_REGEX "ignoring unknown option" # MSVC FAIL_REGEX "[Uu]nknown option" # HP + FAIL_REGEX "[Ww]arning: [Oo]ption" # SunPro + FAIL_REGEX "command option .* is not recognized" # XL ) SET (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}") ENDMACRO (CHECK_C_COMPILER_FLAG) diff --git a/Modules/CheckCXXCompilerFlag.cmake b/Modules/CheckCXXCompilerFlag.cmake index 018eacd70..8f1b7897c 100644 --- a/Modules/CheckCXXCompilerFlag.cmake +++ b/Modules/CheckCXXCompilerFlag.cmake @@ -19,9 +19,11 @@ MACRO (CHECK_CXX_COMPILER_FLAG _FLAG _RESULT) SET(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}") 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 "unrecognized .*option" # GNU FAIL_REGEX "ignoring unknown option" # MSVC FAIL_REGEX "[Uu]nknown option" # HP + FAIL_REGEX "[Ww]arning: [Oo]ption" # SunPro + FAIL_REGEX "command option .* is not recognized" # XL ) SET (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}") ENDMACRO (CHECK_CXX_COMPILER_FLAG)