diff --git a/CMakeLists.txt b/CMakeLists.txt index 7d9dd259fa..d09d98fd39 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -984,11 +984,6 @@ endif() # ! MSVC include(CheckCCompilerFlag) include(CheckCXXCompilerFlag) -if(ENABLE_STATIC) - set(BUILD_SHARED_LIBS 0) -else() - set(BUILD_SHARED_LIBS 1) -endif() function(test_compiler_flag _lang _this_flag _valid_flags_var) string(MAKE_C_IDENTIFIER "${_lang}${_this_flag}_VALID" _flag_var) @@ -3498,7 +3493,7 @@ if(BUILD_dumpcap AND PCAP_FOUND) # # Instead, we just include source files for the relevant code # to be built as part of dumpcap, so that they're built with - # ENABLE_STATIC defined, and will be able to be built with + # BUILD_SHARED_LIBS defined, and will be able to be built with # the static version of libwsutil. # set(dumpcap_FILES @@ -3516,7 +3511,7 @@ if(BUILD_dumpcap AND PCAP_FOUND) set_extra_executable_properties(dumpcap "Executables") target_link_libraries(dumpcap ${dumpcap_LIBS}) target_include_directories(dumpcap SYSTEM PRIVATE ${NL_INCLUDE_DIRS}) - target_compile_definitions(dumpcap PRIVATE ENABLE_STATIC) + target_compile_definitions(dumpcap PRIVATE BUILD_SHARED_LIBS) executable_link_mingw_unicode(dumpcap) install(TARGETS dumpcap RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} diff --git a/CMakeOptions.txt b/CMakeOptions.txt index 8dae80c254..22faca0403 100644 --- a/CMakeOptions.txt +++ b/CMakeOptions.txt @@ -80,7 +80,7 @@ if(WIN32) endif() option(ENABLE_PCAP "Enable libpcap support (required for capturing)" ON) -option(ENABLE_STATIC "Build Wireshark libraries statically" OFF) +option(BUILD_SHARED_LIBS "Build Wireshark libraries as shared" ON) option(USE_STATIC "Always link statically with external libraries" OFF) option(ENABLE_PLUGINS "Build with plugins" ON) option(ENABLE_PLUGIN_IFDEMO "Build with plugin interface demo" OFF) diff --git a/cmakeconfig.h.in b/cmakeconfig.h.in index 428c2fd319..87b38b3803 100644 --- a/cmakeconfig.h.in +++ b/cmakeconfig.h.in @@ -31,9 +31,6 @@ /* Define to 1 if we check hf conflict */ #cmakedefine ENABLE_CHECK_FILTER 1 -/* Link Wireshark libraries statically */ -#cmakedefine ENABLE_STATIC 1 - /* Enable AddressSanitizer (and LeakSanitizer on clang/gcc) */ #cmakedefine ENABLE_ASAN 1 diff --git a/doc/Wireshark_Release_Notes.adoc b/doc/Wireshark_Release_Notes.adoc index f7b81be9db..727cfa6fd7 100644 --- a/doc/Wireshark_Release_Notes.adoc +++ b/doc/Wireshark_Release_Notes.adoc @@ -199,6 +199,7 @@ for Arm64 and Intel. wsbuglink:17294[] === Removed Features and Support Wireshark no longer supports AirPcap and WinPcap. +Cmake option ENABLE_STATIC deprecated in favor of BUILD_SHARED_LIBS // === Removed Dissectors diff --git a/include/ws_symbol_export.h b/include/ws_symbol_export.h index 3de71a8a16..fe77b9008b 100644 --- a/include/ws_symbol_export.h +++ b/include/ws_symbol_export.h @@ -91,7 +91,7 @@ * be necessary, e.g. if what's declared is an array whose size is * not given in the declaration. */ - #ifdef ENABLE_STATIC + #ifdef BUILD_SHARED_LIBS /* * We're building all-static, so we're not building any DLLs. */ @@ -99,7 +99,7 @@ #elif defined(__GNUC__) /* GCC */ #define WS_DLL_PUBLIC_DEF __attribute__ ((dllimport)) - #else /* ! ENABLE_STATIC && ! __GNUC__ */ + #else /* ! BUILD_SHARED_LIBS && ! __GNUC__ */ /* * Presumably MSVC, and we're not building all-static. * Note: actually gcc seems to also support this syntax. diff --git a/writecap/CMakeLists.txt b/writecap/CMakeLists.txt index eb816436f3..33b9a0786e 100644 --- a/writecap/CMakeLists.txt +++ b/writecap/CMakeLists.txt @@ -37,7 +37,7 @@ set_target_properties(writecap PROPERTIES target_compile_definitions(writecap PRIVATE # Necessary to avoid C4273 inconsistent DLL linkage on MSVC - ENABLE_STATIC + BUILD_SHARED_LIBS ) target_link_libraries(writecap diff --git a/wsutil/CMakeLists.txt b/wsutil/CMakeLists.txt index 53b5d8202f..b47ed18d48 100644 --- a/wsutil/CMakeLists.txt +++ b/wsutil/CMakeLists.txt @@ -430,7 +430,7 @@ add_library(wsutil_static STATIC ) target_compile_definitions(wsutil_static PRIVATE - ENABLE_STATIC + BUILD_SHARED_LIBS BUILD_WSUTIL )