aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/modules/WiresharkPlugin.cmake
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2018-02-03 12:25:24 -0800
committerGuy Harris <guy@alum.mit.edu>2018-02-03 21:04:14 +0000
commitd5f52cfaf51e81db8b268da0b4c572d19b809432 (patch)
tree35ec611e633596f05129a9eed7b3f11abb1d9e1d /cmake/modules/WiresharkPlugin.cmake
parentd8551c42473bc345840cccc3a5ba710ab1649b55 (diff)
Don't link wiretap plugins with libwireshark.
Make the second argument to add_plugin_library() and install_plugin() be a plugin type - currently, either "epan" or "wiretap" - and, based on its value, set the subfolder and required libraries in add_plugin_library() and the subfolder in install_plugin(). If it's not one of the known values, fail. Change-Id: I556863772c59330d2854fbb4673f544f8359dcd2 Reviewed-on: https://code.wireshark.org/review/25579 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'cmake/modules/WiresharkPlugin.cmake')
-rw-r--r--cmake/modules/WiresharkPlugin.cmake24
1 files changed, 21 insertions, 3 deletions
diff --git a/cmake/modules/WiresharkPlugin.cmake b/cmake/modules/WiresharkPlugin.cmake
index 0cf67debcd..9be5a49b35 100644
--- a/cmake/modules/WiresharkPlugin.cmake
+++ b/cmake/modules/WiresharkPlugin.cmake
@@ -28,7 +28,17 @@ 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 _subfolder)
+macro(ADD_PLUGIN_LIBRARY _plugin _plugin_type)
+ if(${_plugin_type} STREQUAL "epan")
+ set(_subfolder "epan")
+ set(_required_libraries "epan")
+ elseif(${_plugin_type} STREQUAL "wiretap")
+ set(_subfolder "wiretap")
+ set(_required_libraries "wiretap")
+ else()
+ message(FATAL_ERROR "add_plugin_library called with invalid plugin type ${_plugin_type}")
+ endif()
+
add_library(${_plugin} MODULE
${PLUGIN_FILES}
${PLUGIN_RC_FILE}
@@ -53,11 +63,19 @@ macro(ADD_PLUGIN_LIBRARY _plugin _subfolder)
)
endforeach()
- target_link_libraries(${_plugin} epan)
+ target_link_libraries(${_plugin} ${_required_libraries})
add_dependencies(plugins ${_plugin})
endmacro()
-macro(INSTALL_PLUGIN _plugin _subfolder)
+macro(INSTALL_PLUGIN _plugin _plugin_type)
+ if(${_plugin_type} STREQUAL "epan")
+ set(_subfolder "epan")
+ elseif(${_plugin_type} STREQUAL "wiretap")
+ set(_subfolder "wiretap")
+ else()
+ message(FATAL_ERROR "install_plugin called with invalid plugin type ${_plugin_type}")
+ endif()
+
install(TARGETS ${_plugin}
LIBRARY DESTINATION ${PLUGIN_INSTALL_LIBDIR}/${_subfolder} NAMELINK_SKIP
RUNTIME DESTINATION ${PLUGIN_INSTALL_LIBDIR}