plugins.example: Add some comments

This commit is contained in:
João Valverde 2022-03-28 12:23:37 +01:00 committed by A Wireshark GitLab Utility
parent e3765215aa
commit 8df570294f
1 changed files with 7 additions and 1 deletions

View File

@ -24,11 +24,12 @@ if(NOT Wireshark_PLUGINS_ENABLED)
message(WARNING "Wireshark was compiled without support for plugins")
endif()
# External plugins must define HAVE_SSIZE_T for the plugin toolchain.
include(CheckTypeSize)
check_type_size("ssize_t" SSIZE_T)
set(CMAKE_C_VISIBILITY_PRESET hidden)
if (CMAKE_COMPILER_IS_GNUCC)
if(CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_C_FLAGS "-Wall -Wextra ${CMAKE_C_FLAGS}")
endif()
@ -41,10 +42,15 @@ add_library(hello MODULE hello.c)
set_target_properties(hello PROPERTIES PREFIX "" DEFINE_SYMBOL "")
target_link_libraries(hello epan)
# This is the normal installation target to CMAKE_INSTALL_PREFIX. It is relocatable
# using DESTDIR or cmake --install. By default CMAKE_INSTALL_PREFIX should be configured
# correctly for Wireshark's system installation prefix.
install(TARGETS hello
LIBRARY DESTINATION "${Wireshark_PLUGIN_LIBDIR}/epan" NAMELINK_SKIP
)
# This custom target installs the plugin to the plugin dir in WiresharkConfig.cmake.
# It does not use CMAKE_INSTALL_PREFIX.
add_custom_target(copy_plugin
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:hello> ${Wireshark_PLUGIN_INSTALL_DIR}
COMMENT "Installing plugin to: ${Wireshark_PLUGIN_INSTALL_DIR}"