CMake: Do not disable -Werror with "extra compiler warnings"

Give the ENABLE_WERROR option full control of -Werror. Silently
overriding the user configuration is potentially confusing and
unnecessary.
This commit is contained in:
João Valverde 2022-11-12 21:07:13 +00:00
parent 2443df7318
commit e1d492e2e0
3 changed files with 4 additions and 4 deletions

View File

@ -540,7 +540,7 @@ Code Checks + Clang Warnings:
- cd build
- printf "\e[0Ksection_start:%s:cmake_section[collapsed=true]\r\e[0KRunning CMake" "$( date +%s)"
# We don't have an "All options" job, so build fuzzshark and tfshark here.
- cmake -DENABLE_EXTRA_COMPILER_WARNINGS=on -DENABLE_CHECKHF_CONFLICT=on -DCMAKE_EXPORT_COMPILE_COMMANDS=on -DBUILD_fuzzshark=ON -DBUILD_tfshark=On -DBUILD_logray=ON -DENABLE_CCACHE=ON -G Ninja ..
- cmake -DENABLE_EXTRA_COMPILER_WARNINGS=on -DENABLE_WERROR=off -DENABLE_CHECKHF_CONFLICT=on -DCMAKE_EXPORT_COMPILE_COMMANDS=on -DBUILD_fuzzshark=ON -DBUILD_tfshark=On -DBUILD_logray=ON -DENABLE_CCACHE=ON -G Ninja ..
- printf "\e[0Ksection_end:%s:cmake_section\r\e[0K" "$( date +%s)"
- mkdir ../html
- script --command ninja --flush --quiet --return ../tmp_clang_report.txt

View File

@ -718,7 +718,7 @@ else() # ! MSVC
# These are not enabled by default, because the warnings they
# produce are very hard or impossible to eliminate.
#
if(ENABLE_EXTRA_COMPILER_WARNINGS) # This overrides -Werror
if(ENABLE_EXTRA_COMPILER_WARNINGS)
list(APPEND WIRESHARK_COMMON_FLAGS
# The following are for C and C++
-Wpedantic
@ -963,7 +963,7 @@ if(MSVC)
endif()
set(WERROR_COMMON_FLAGS "")
if(ENABLE_WERROR AND NOT ENABLE_EXTRA_COMPILER_WARNINGS)
if(ENABLE_WERROR)
if(CMAKE_C_COMPILER_ID MATCHES "MSVC")
set(WERROR_COMMON_FLAGS "/WX")
else()

View File

@ -59,7 +59,7 @@ option(ENABLE_DEBUG_MBS "Enable extra debug checks for detecting invalid multib
option(ENABLE_CCACHE "Speed up compiling and linking using ccache if possible" OFF)
option(DISABLE_FRAME_LARGER_THAN_WARNING "Disable warning if the size of a function frame is large" OFF)
option(EXTCAP_ANDROIDDUMP_LIBPCAP "Build androiddump using libpcap" OFF)
option(ENABLE_EXTRA_COMPILER_WARNINGS "Do additional compiler warnings (disables -Werror)" OFF)
option(ENABLE_EXTRA_COMPILER_WARNINGS "Do additional compiler warnings (noisy)" OFF)
option(ENABLE_CODE_ANALYSIS "Enable the compiler's static analyzer if possible" OFF)
option(ENABLE_ASAN "Enable AddressSanitizer (ASAN) for debugging (degrades performance)" OFF)
option(ENABLE_TSAN "Enable ThreadSanitizer (TSan) for debugging" OFF)