We don't need -Werror=unknown-warning-option with Clang.

check_c_compiler_flag checks for the message Clang prints for an unknown
warning option ("unknown warning option '-WXXX'"), and fails if it's
produced, so we don't need to force the compiler to fail by passing it
-Werror=unknown-warning-option.

(Yes, the CMake way of handling those annoying options is different from
the way we do that in autotools - autotools adds flags to force errors,
CMake checks for the warning messages - but that's OK.)

Change-Id: I5c2e5d6f4826eba7048736d5134d20417778276a
Reviewed-on: https://code.wireshark.org/review/2400
Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
Guy Harris 2014-06-18 11:55:02 -07:00
parent 5e5e2019ee
commit c6007e8d26
1 changed files with 0 additions and 6 deletions

View File

@ -336,16 +336,10 @@ include(CheckCCompilerFlag)
include(CheckCXXCompilerFlag)
if(NOT DISABLE_WERROR AND NOT ENABLE_EXTRA_COMPILER_WARNINGS)
check_c_compiler_flag(-Werror=unknown-warning-option WERR_UNKNOWN)
check_c_compiler_flag(-Werror WERROR)
else()
set(WERR_UNKNOWN FALSE)
set(WERROR FALSE)
endif()
# string of additional compile command line flags for check_c_compiler_flag
if(WERR_UNKNOWN)
set(CMAKE_REQUIRED_FLAGS -Werror=unknown-warning-option )
endif()
# Sigh: Have to use THIS_FLAG instead of ${F} for some reason
foreach(THIS_FLAG ${C_FLAG_TESTS})