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 /CMakeLists.txt | |
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 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 34 |
1 files changed, 7 insertions, 27 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 51a5d577bc..c7749e3b3f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1609,24 +1609,6 @@ else() endif() set(EXTCAP_INSTALL_FULL_LIBDIR "${CMAKE_INSTALL_PREFIX}/${EXTCAP_INSTALL_LIBDIR}") -if(APPLE) - # - # As https://developer.apple.com/library/archive/technotes/tn2206/_index.html - # says, - # - # "Note that a location where code is expected to reside cannot generally - # contain directories full of nested code, because those directories tend - # to be interpreted as bundles. So this occasional practice is not - # recommended and not officially supported. If you do do this, do not use - # periods in the directory names. The code signing machinery interprets - # directories with periods in their names as code bundles and will reject - # them if they don't conform to the expected code bundle layout." - # - set(PLUGIN_PATH_ID "${PROJECT_MAJOR_VERSION}-${PROJECT_MINOR_VERSION}") -else() - set(PLUGIN_PATH_ID "${PROJECT_MAJOR_VERSION}.${PROJECT_MINOR_VERSION}") -endif() - # Directory where plugins and Lua dissectors can be found. if(WIN32 AND NOT USE_MSYSTEM) set(PLUGIN_INSTALL_LIBDIR "plugins" CACHE INTERNAL "The plugin dir") @@ -1634,8 +1616,6 @@ else() set(PLUGIN_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}/plugins" CACHE INTERNAL "The plugin dir") endif() set(PLUGIN_INSTALL_FULL_LIBDIR "${CMAKE_INSTALL_PREFIX}/${PLUGIN_INSTALL_LIBDIR}") -set(PLUGIN_INSTALL_VERSION_LIBDIR "${PLUGIN_INSTALL_LIBDIR}/${PLUGIN_PATH_ID}") -set(PLUGIN_VERSION_DIR "plugins/${PLUGIN_PATH_ID}") add_subdirectory( capture ) add_subdirectory( doc ) @@ -1788,22 +1768,22 @@ endif() if(ENABLE_APPLICATION_BUNDLE) if(CMAKE_CFG_INTDIR STREQUAL ".") - set(_plugin_dir "${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/PlugIns/wireshark/${PLUGIN_PATH_ID}") + set(_plugin_dir "${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/PlugIns/wireshark") else() # Xcode - set(_plugin_dir "${CMAKE_BINARY_DIR}/run/$<CONFIG>/Wireshark.app/Contents/PlugIns/wireshark/${PLUGIN_PATH_ID}") + set(_plugin_dir "${CMAKE_BINARY_DIR}/run/$<CONFIG>/Wireshark.app/Contents/PlugIns/wireshark") endif() if(CMAKE_CFG_INTDIR STREQUAL ".") - set(_logray_plugin_dir "${CMAKE_BINARY_DIR}/run/Logray.app/Contents/PlugIns/logray/${PLUGIN_PATH_ID}") + set(_logray_plugin_dir "${CMAKE_BINARY_DIR}/run/Logray.app/Contents/PlugIns/logray") else() # Xcode - set(_logray_plugin_dir "${CMAKE_BINARY_DIR}/run/$<CONFIG>/Logray.app/Contents/PlugIns/logray/${PLUGIN_PATH_ID}") + set(_logray_plugin_dir "${CMAKE_BINARY_DIR}/run/$<CONFIG>/Logray.app/Contents/PlugIns/logray") endif() elseif(MSVC AND NOT CMAKE_CFG_INTDIR STREQUAL ".") - set(_plugin_dir "${CMAKE_BINARY_DIR}/run/$<CONFIG>/${PLUGIN_VERSION_DIR}") + set(_plugin_dir "${CMAKE_BINARY_DIR}/run/$<CONFIG>/plugins") set(_logray_plugin_dir ${_plugin_dir}) else() - set(_plugin_dir "${DATAFILE_DIR}/${PLUGIN_VERSION_DIR}") + set(_plugin_dir "${DATAFILE_DIR}/plugins") set(_logray_plugin_dir ${_plugin_dir}) endif() set (PLUGIN_DIR ${_plugin_dir} CACHE INTERNAL "Build time plugin location.") @@ -4103,7 +4083,7 @@ configure_package_config_file(WiresharkConfig.cmake.in PATH_VARS CMAKE_INSTALL_LIBDIR CMAKE_INSTALL_INCLUDEDIR - PLUGIN_INSTALL_VERSION_LIBDIR + PLUGIN_INSTALL_LIBDIR EXTCAP_INSTALL_LIBDIR ) |