diff --git a/CMakeLists.txt b/CMakeLists.txt index 0fc9129857..67e49b0519 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2591,6 +2591,7 @@ if(BUILD_wireshark AND QT_FOUND) wiretap epan version_info + summary ${QT_LIBRARIES} ${APPLE_APPLICATION_SERVICES_LIBRARY} ${APPLE_APPKIT_LIBRARY} @@ -2696,6 +2697,7 @@ if(BUILD_logray AND QT_FOUND) wiretap epan version_info + summary ${QT_LIBRARIES} ${APPLE_APPLICATION_SERVICES_LIBRARY} ${APPLE_APPKIT_LIBRARY} @@ -2854,6 +2856,7 @@ if(BUILD_tshark) caputils wiretap epan + wsutil version_info ${APPLE_CORE_FOUNDATION_LIBRARY} ${APPLE_SYSTEM_CONFIGURATION_LIBRARY} @@ -2935,7 +2938,6 @@ if(BUILD_sharkd) ${APPLE_SYSTEM_CONFIGURATION_LIBRARY} ${WIN_WS2_32_LIBRARY} ${SPEEXDSP_LIBRARIES} - ${M_LIBRARIES} ) set(sharkd_FILES # @@ -2978,9 +2980,6 @@ if(BUILD_randpkt) ui wiretap wsutil - ${M_LIBRARIES} - ${CARES_LIBRARIES} - ${ZLIB_LIBRARIES} ) set(randpkt_FILES $ @@ -3006,7 +3005,6 @@ if(BUILD_text2pcap) ui epan version_info - ${M_LIBRARIES} ${ZLIB_LIBRARIES} ) set(text2pcap_FILES @@ -3137,7 +3135,6 @@ if(BUILD_dumpcap AND PCAP_FOUND) version_info pcap::pcap ${CAP_LIBRARIES} - ${GTHREAD2_LIBRARIES} ${ZLIB_LIBRARIES} ${APPLE_CORE_FOUNDATION_LIBRARY} ${APPLE_SYSTEM_CONFIGURATION_LIBRARY} diff --git a/capture/CMakeLists.txt b/capture/CMakeLists.txt index f25ddb31e6..fa3b56f272 100644 --- a/capture/CMakeLists.txt +++ b/capture/CMakeLists.txt @@ -48,12 +48,15 @@ add_library(caputils STATIC target_link_libraries(caputils PUBLIC - wsutil $<$:pcap::pcap> PRIVATE + wsutil ${NL_LIBRARIES} ${WIN_IPHLPAPI_LIBRARY} ) +if(WIN32) + target_link_libraries(caputils PRIVATE ${GMODULE2_LIBRARIES}) +endif() target_include_directories(caputils SYSTEM PRIVATE diff --git a/epan/CMakeLists.txt b/epan/CMakeLists.txt index 122b271b6c..42509db527 100644 --- a/epan/CMakeLists.txt +++ b/epan/CMakeLists.txt @@ -323,16 +323,15 @@ endif() target_link_libraries(epan PUBLIC - wiretap wsutil ${GLIB2_LIBRARIES} PRIVATE + wiretap ${BROTLI_LIBRARIES} ${CARES_LIBRARIES} ${GCRYPT_LIBRARIES} ${GIO2_LIBRARIES} ${GNUTLS_LIBRARIES} - ${GTHREAD2_LIBRARIES} ${KERBEROS_LIBRARIES} ${LIBXML2_LIBRARIES} ${LUA_LIBRARIES} @@ -366,7 +365,6 @@ target_include_directories(epan ${GCRYPT_INCLUDE_DIRS} ${GLIB2_INCLUDE_DIRS} ${GNUTLS_INCLUDE_DIRS} - ${GTHREAD2_INCLUDE_DIRS} ${LIBXML2_INCLUDE_DIRS} ${LUA_INCLUDE_DIRS} ${LZ4_INCLUDE_DIRS} @@ -404,7 +402,7 @@ set_target_properties(exntest PROPERTIES ) add_executable(oids_test EXCLUDE_FROM_ALL oids_test.c) -target_link_libraries(oids_test epan ${ZLIB_LIBRARIES}) +target_link_libraries(oids_test epan) set_target_properties(oids_test PROPERTIES FOLDER "Tests" EXCLUDE_FROM_DEFAULT_BUILD True diff --git a/epan/epan.c b/epan/epan.c index cc98603c52..3ab549e7ad 100644 --- a/epan/epan.c +++ b/epan/epan.c @@ -220,7 +220,7 @@ void epan_register_plugin(const epan_plugin *plug _U_) int epan_plugins_supported(void) { #ifdef HAVE_PLUGINS - return g_module_supported() ? 0 : 1; + return plugins_supported() ? 0 : 1; #else return -1; #endif diff --git a/extcap/CMakeLists.txt b/extcap/CMakeLists.txt index 48388a3317..6b175a83de 100644 --- a/extcap/CMakeLists.txt +++ b/extcap/CMakeLists.txt @@ -136,7 +136,6 @@ if(BUILD_androiddump) ui wiretap wsutil - ${ZLIB_LIBRARIES} ${CMAKE_DL_LIBS} ${WIN_WS2_32_LIBRARY} ) @@ -236,6 +235,7 @@ if(BUILD_dpauxmon AND HAVE_LIBNL3) set(dpauxmon_LIBS wsutil writecap + ${GLIB2_LIBRARIES} ${CMAKE_DL_LIBS} ${NL_LIBRARIES} ) @@ -282,7 +282,6 @@ if(BUILD_randpktdump) randpkt_core wiretap wsutil - ${ZLIB_LIBRARIES} ${CMAKE_DL_LIBS} ${WIN_WS2_32_LIBRARY} ) @@ -308,7 +307,6 @@ if(BUILD_etwdump AND WIN32) tdh wevtapi rpcrt4 - ${ZLIB_LIBRARIES} ${CMAKE_DL_LIBS} ${WIN_WS2_32_LIBRARY} ) @@ -331,13 +329,10 @@ endif() if(BUILD_sdjournal AND SYSTEMD_FOUND) set(sdjournal_LIBS - wiretap writecap wsutil - ${ZLIB_LIBRARIES} ${CMAKE_DL_LIBS} ${SYSTEMD_LIBRARIES} - ${GCRYPT_LIBRARIES} ) set(sdjournal_FILES $ diff --git a/ui/CMakeLists.txt b/ui/CMakeLists.txt index 0aba6e3bbd..e37200f992 100644 --- a/ui/CMakeLists.txt +++ b/ui/CMakeLists.txt @@ -40,7 +40,6 @@ set(NONGENERATED_UI_SRC service_response_time.c software_update.c ssl_key_export.c - summary.c tap_export_pdu.c tap-iax2-analysis.c tap-rtp-analysis.c @@ -80,17 +79,28 @@ add_library(ui STATIC ${UI_SRC}) target_link_libraries(ui PRIVATE - caputils + wsutil +) + +target_include_directories(ui + SYSTEM PRIVATE + ${PCAP_INCLUDE_DIRS} + ${WINSPARKLE_INCLUDE_DIRS} +) + +add_library(summary STATIC summary.c) + +target_link_libraries(summary + PRIVATE wiretap + epan wsutil ${GCRYPT_LIBRARIES} ) -target_include_directories(ui +target_include_directories(summary SYSTEM PRIVATE ${GCRYPT_INCLUDE_DIRS} - ${GNUTLS_INCLUDE_DIRS} - ${WINSPARKLE_INCLUDE_DIRS} ) add_library(version_info STATIC version_info.c) diff --git a/ui/version_info.c b/ui/version_info.c index dd0348a3a0..2d001f33cf 100644 --- a/ui/version_info.c +++ b/ui/version_info.c @@ -490,7 +490,7 @@ get_runtime_version_info(gather_feature_func gather_runtime) } #ifdef HAVE_PLUGINS - if (g_module_supported()) { + if (plugins_supported()) { g_string_append(str, ", binary plugins supported"); } #endif diff --git a/wiretap/CMakeLists.txt b/wiretap/CMakeLists.txt index 1d1da81f53..51b6230de0 100644 --- a/wiretap/CMakeLists.txt +++ b/wiretap/CMakeLists.txt @@ -185,6 +185,7 @@ endif() target_link_libraries(wiretap PUBLIC wsutil + ${GLIB2_LIBRARIES} PRIVATE ${ZLIB_LIBRARIES} ${ZSTD_LIBRARIES} diff --git a/wiretap/wtap.c b/wiretap/wtap.c index fca574265d..d18ff3dcad 100644 --- a/wiretap/wtap.c +++ b/wiretap/wtap.c @@ -49,7 +49,7 @@ int wtap_plugins_supported(void) { #ifdef HAVE_PLUGINS - return g_module_supported() ? 0 : 1; + return plugins_supported() ? 0 : 1; #else return -1; #endif diff --git a/wsutil/CMakeLists.txt b/wsutil/CMakeLists.txt index 08e16ee37a..bfa69a5965 100644 --- a/wsutil/CMakeLists.txt +++ b/wsutil/CMakeLists.txt @@ -302,27 +302,26 @@ if(MSVC) endif() target_link_libraries(wsutil - # *Lots* of our targets that link with wsutil also link with - # GLib and GModule. Mark them PUBLIC so that dependent targets - # don't have to link them directly. PUBLIC ${GLIB2_LIBRARIES} - ${GMODULE2_LIBRARIES} PRIVATE + ${GMODULE2_LIBRARIES} ${APPLE_CORE_FOUNDATION_LIBRARY} ${CMAKE_DL_LIBS} ${GCRYPT_LIBRARIES} ${GNUTLS_LIBRARIES} ${PCRE2_LIBRARIES} - ${M_LIBRARIES} ${WIN_IPHLPAPI_LIBRARY} ${WIN_WS2_32_LIBRARY} ) -target_include_directories(wsutil - SYSTEM PRIVATE +target_include_directories(wsutil SYSTEM + PUBLIC + ${GLIB2_INCLUDE_DIRS} ${GCRYPT_INCLUDE_DIRS} ${GNUTLS_INCLUDE_DIRS} + PRIVATE + ${GMODULE2_INCLUDE_DIRS} ${PCRE2_INCLUDE_DIRS} ) diff --git a/wsutil/plugins.c b/wsutil/plugins.c index 2fccadfa01..5c80bdfa14 100644 --- a/wsutil/plugins.c +++ b/wsutil/plugins.c @@ -300,6 +300,12 @@ plugins_cleanup(plugins_t *plugins) g_hash_table_destroy((GHashTable *)plugins); } +gboolean +plugins_supported(void) +{ + return g_module_supported(); +} + /* * Editor modelines * diff --git a/wsutil/plugins.h b/wsutil/plugins.h index 2cf2c4e80d..3616cb3153 100644 --- a/wsutil/plugins.h +++ b/wsutil/plugins.h @@ -12,7 +12,6 @@ #define __PLUGINS_H__ #include -#include #ifdef __cplusplus extern "C" { @@ -42,6 +41,8 @@ WS_DLL_PUBLIC int plugins_get_count(void); WS_DLL_PUBLIC void plugins_cleanup(plugins_t *plugins); +WS_DLL_PUBLIC gboolean plugins_supported(void); + #ifdef __cplusplus } #endif /* __cplusplus */