aboutsummaryrefslogtreecommitdiffstats
path: root/wsutil
diff options
context:
space:
mode:
authorJoão Valverde <j@v6e.pt>2023-01-30 20:27:06 +0000
committerJoão Valverde <j@v6e.pt>2023-02-06 15:04:46 +0000
commitb07ab25a1c1293d72e71ecd728386ea9ed9658df (patch)
treefe5d4528f3931e91c894d477fa1a70d408172dc9 /wsutil
parent2855c8ec46637babf47534bcba42b0dfeb1e3081 (diff)
CMake: Cleanup unnecessary linking with shared libraries
Diffstat (limited to 'wsutil')
-rw-r--r--wsutil/CMakeLists.txt13
-rw-r--r--wsutil/plugins.c6
-rw-r--r--wsutil/plugins.h3
3 files changed, 14 insertions, 8 deletions
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 <wireshark.h>
-#include <gmodule.h>
#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 */