diff options
author | João Valverde <j@v6e.pt> | 2023-12-13 02:14:33 +0000 |
---|---|---|
committer | João Valverde <j@v6e.pt> | 2023-12-14 14:28:30 +0000 |
commit | b52d9173f8f0201a360bc1d5ada38297a6e13553 (patch) | |
tree | 1b425618898ee981be3d38830c403944c382d1f7 /cmake/modules | |
parent | b51a3933ba8ace3f583259f5fd420a47912c86ad (diff) |
Remove version component from plugin path
Remove the major.minor version from the plugin path, i.e:
lib/plugins/X.Y/{epan,wiretap,codecs}
and use an unversioned path:
lib/plugins/{epan,wiretap,codecs}
Introduce a new naming policy for plugins that requires
name.so.ABI_VERSION.
This is a simplified filesystem layoutfor plugins some
important benefits such as:
* improves compatibility between Wireshark versions, because
a plugin that wasn't recompiled will be automatically picked
up, but only if it has a compatible ABI version in the file name.
* does not clash with Apple guidelines
* simpler for users to understand and apply
* just overall simpler and easier to maintain, removes a lot
of complexity from CMake code
It does impose more requirements on the plugin naming scheme
but this should be handled completely transparently
by the build system.
It would also be possible to add support for unversioned *.so file
extensions at the same time, although in ths case it is not possible
to support multiple Wireshark ABI versions with only *.so, of course.
This wasn't done here but it may or may not be a useful enhancement
in the future.
Follow-up to 90b16b40921b737aadf9186685d866fd80e37ee6.
Diffstat (limited to 'cmake/modules')
-rw-r--r-- | cmake/modules/WiresharkPlugin.cmake | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/cmake/modules/WiresharkPlugin.cmake b/cmake/modules/WiresharkPlugin.cmake index b8975d3989..4d8cd7a9f8 100644 --- a/cmake/modules/WiresharkPlugin.cmake +++ b/cmake/modules/WiresharkPlugin.cmake @@ -28,7 +28,7 @@ macro(SET_MODULE_INFO _plugin _ver_major _ver_minor _ver_micro _ver_extra) add_definitions(-DPLUGIN_VERSION=\"${PLUGIN_VERSION}\") endmacro() -macro(ADD_PLUGIN_LIBRARY _plugin _output_dir) +macro(ADD_PLUGIN_LIBRARY _plugin _output_dir _abi_version) add_library(${_plugin} MODULE ${PLUGIN_FILES} ${PLUGIN_RC_FILE} @@ -38,6 +38,7 @@ macro(ADD_PLUGIN_LIBRARY _plugin _output_dir) set_target_properties(${_plugin} PROPERTIES PREFIX "" + SUFFIX "${CMAKE_SHARED_MODULE_SUFFIX}.${_abi_version}" LINK_FLAGS "${WS_LINK_FLAGS}" FOLDER "Plugins" LIBRARY_OUTPUT_DIRECTORY ${_output_dir} @@ -51,25 +52,25 @@ macro(ADD_PLUGIN_LIBRARY _plugin _output_dir) endmacro() macro(ADD_WIRESHARK_EPAN_PLUGIN_LIBRARY _plugin) - ADD_PLUGIN_LIBRARY(${_plugin} "${PLUGIN_DIR}/epan") + ADD_PLUGIN_LIBRARY(${_plugin} "${PLUGIN_DIR}/epan" ${PROJECT_ABI_VERSION_EPAN}) endmacro() macro(ADD_WIRESHARK_WIRETAP_PLUGIN_LIBRARY _plugin) - ADD_PLUGIN_LIBRARY(${_plugin} "${PLUGIN_DIR}/wiretap") + ADD_PLUGIN_LIBRARY(${_plugin} "${PLUGIN_DIR}/wiretap" ${PROJECT_ABI_VERSION_WIRETAP}) endmacro() macro(ADD_WIRESHARK_CODEC_PLUGIN_LIBRARY _plugin) - ADD_PLUGIN_LIBRARY(${_plugin} "${PLUGIN_DIR}/codecs") + ADD_PLUGIN_LIBRARY(${_plugin} "${PLUGIN_DIR}/codecs" ${PROJECT_ABI_VERSION_CODEC}) endmacro() macro(ADD_LOGRAY_EPAN_PLUGIN_LIBRARY _plugin) - ADD_PLUGIN_LIBRARY(${_plugin} "${LOGRAY_PLUGIN_DIR}/epan") + ADD_PLUGIN_LIBRARY(${_plugin} "${LOGRAY_PLUGIN_DIR}/epan" ${PROJECT_ABI_VERSION_EPAN}) endmacro() macro(INSTALL_PLUGIN _plugin _subfolder) install(TARGETS ${_plugin} - LIBRARY DESTINATION ${PLUGIN_INSTALL_VERSION_LIBDIR}/${_subfolder} NAMELINK_SKIP - RUNTIME DESTINATION ${PLUGIN_INSTALL_VERSION_LIBDIR} - ARCHIVE DESTINATION ${PLUGIN_INSTALL_VERSION_LIBDIR} + LIBRARY DESTINATION ${PLUGIN_INSTALL_LIBDIR}/${_subfolder} NAMELINK_SKIP + RUNTIME DESTINATION ${PLUGIN_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${PLUGIN_INSTALL_LIBDIR} ) endmacro() |