CheckCCompilerFlag: Generalize "but not for C" case (#12633)
The "warning: " part is not necessary. The case can happen on any GNU compiler, not just an Apple version.
This commit is contained in:
parent
4e98500012
commit
646cf91932
|
@ -7,7 +7,7 @@
|
||||||
# that can modify the build.
|
# that can modify the build.
|
||||||
|
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
# Copyright 2006-2010 Kitware, Inc.
|
# Copyright 2006-2011 Kitware, Inc.
|
||||||
# Copyright 2006 Alexander Neundorf <neundorf@kde.org>
|
# Copyright 2006 Alexander Neundorf <neundorf@kde.org>
|
||||||
#
|
#
|
||||||
# Distributed under the OSI-approved BSD License (the "License");
|
# Distributed under the OSI-approved BSD License (the "License");
|
||||||
|
@ -27,8 +27,7 @@ MACRO (CHECK_C_COMPILER_FLAG _FLAG _RESULT)
|
||||||
SET(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}")
|
SET(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}")
|
||||||
CHECK_C_SOURCE_COMPILES("int main(void) { return 0; }" ${_RESULT}
|
CHECK_C_SOURCE_COMPILES("int main(void) { return 0; }" ${_RESULT}
|
||||||
# Some compilers do not fail with a bad flag
|
# Some compilers do not fail with a bad flag
|
||||||
FAIL_REGEX "warning: command line option .* is valid for .* but not for C"
|
FAIL_REGEX "command line option .* is valid for .* but not for C" # GNU
|
||||||
# Apple gcc
|
|
||||||
FAIL_REGEX "unrecognized .*option" # GNU
|
FAIL_REGEX "unrecognized .*option" # GNU
|
||||||
FAIL_REGEX "unknown .*option" # Clang
|
FAIL_REGEX "unknown .*option" # Clang
|
||||||
FAIL_REGEX "ignoring unknown option" # MSVC
|
FAIL_REGEX "ignoring unknown option" # MSVC
|
||||||
|
|
Loading…
Reference in New Issue