CMake: Use more consistent naming for options

Having some options use DISABLE_ and others ENABLE_ is inconsistent
and difficult to remember. Use ENABLE_ instead consistently.

Frame-larger-than remains an exception.
This commit is contained in:
João Valverde 2021-12-30 01:05:57 +00:00 committed by A Wireshark GitLab Utility
parent 60dd63892a
commit 119473eab3
6 changed files with 14 additions and 11 deletions

View File

@ -697,7 +697,7 @@ Clang Static Analyzer:
CC: "clang-${CLANG_VERSION}"
CXX: "clang++-${CLANG_VERSION}"
script:
- scan-build-${CLANG_VERSION} cmake -DCMAKE_BUILD_TYPE=Debug -DDISABLE_WERROR=ON -G Ninja ..
- scan-build-${CLANG_VERSION} cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_WERROR=OFF -G Ninja ..
- scan-build-${CLANG_VERSION} -o ../sbout ninja
- cd ../sbout
- RAW_DIR=$( find ../sbout -type d -name "20??-??-??-*" -printf "%P\n" | head )

View File

@ -464,8 +464,8 @@ set_property(DIRECTORY
PROPERTY COMPILE_DEFINITIONS
"G_DISABLE_DEPRECATED"
"G_DISABLE_SINGLE_INCLUDES"
$<$<OR:$<BOOL:${DISABLE_ASSERT}>,$<CONFIG:Release>>:WS_DISABLE_ASSERT>
$<$<OR:$<BOOL:${DISABLE_DEBUG}>,$<CONFIG:Release>>:WS_DISABLE_DEBUG>
$<$<OR:$<NOT:$<BOOL:${ENABLE_ASSERT}>>,$<CONFIG:Release>>:WS_DISABLE_ASSERT>
$<$<OR:$<NOT:$<BOOL:${ENABLE_DEBUG}>>,$<CONFIG:Release>>:WS_DISABLE_DEBUG>
)
if(WIN32)
@ -987,7 +987,7 @@ if(MSVC)
endif()
set(WERROR_COMMON_FLAGS "")
if(NOT DISABLE_WERROR AND NOT ENABLE_EXTRA_COMPILER_WARNINGS)
if(ENABLE_WERROR AND NOT ENABLE_EXTRA_COMPILER_WARNINGS)
if(CMAKE_C_COMPILER_ID MATCHES "MSVC")
set(WERROR_COMMON_FLAGS "/WX")
else()

View File

@ -48,9 +48,10 @@ else()
endif()
option(BUILD_mmdbresolve "Build MaxMind DB resolver" ON)
option(DISABLE_WERROR "Do not treat warnings as errors" OFF)
option(DISABLE_DEBUG "Disable debug code" OFF)
option(DISABLE_ASSERT "Disable assertions" OFF)
option(ENABLE_WERROR "Treat warnings as errors" ON)
option(ENABLE_DEBUG "Enable debug code" ON)
option(ENABLE_ASSERT "Enable assertions" ON)
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)
@ -60,7 +61,6 @@ option(ENABLE_TSAN "Enable ThreadSanitizer (TSan) for debugging" OFF)
option(ENABLE_UBSAN "Enable UndefinedBehaviorSanitizer (UBSan) for debugging" OFF)
option(ENABLE_FUZZER "Enable libFuzzer instrumentation for use with fuzzshark" OFF)
option(ENABLE_CHECKHF_CONFLICT "Enable hf conflict check for debugging (start-up may be slower)" OFF)
option(ENABLE_CCACHE "Speed up compiling and linking using ccache if possible" OFF)
if(CMAKE_GENERATOR STREQUAL "Ninja")
option(ENABLE_COMPILER_COLOR_DIAGNOSTICS "Always enable the compiler's color diagnostic output" ON)

View File

@ -37,7 +37,7 @@ From this point on it's a typical ninja build:
3. Run cmake:
$ cmake -DENABLE_CCACHE=Yes -DDISABLE_WERROR=Yes ..
$ cmake -DENABLE_CCACHE=Yes -DENABLE_WERROR=No ..
4. Build by running "ninja" in the build directory:

View File

@ -74,7 +74,10 @@ They previously shipped with Npcap 1.55.
* It is possible to set extcap passwords on cli for tshark and other cli tools.
// === Removed Features and Support
=== Removed Features and Support
* CMake: The options starting with DISABLE_something were renamed ENABLE_something for consistency.
For example DISABLE_WERROR=On became ENABLE_WERROR=Off. The defaults are unchanged.
// === Removed Dissectors

View File

@ -364,7 +364,7 @@ cmake \
%else
-DENABLE_BROTLI=OFF \
%endif
-DDISABLE_WERROR=ON \
-DENABLE_WERROR=OFF \
%if %{with ninja}
-G Ninja \
%endif