From 651e0884b7d9fdf64d5310c4e317d757d2357259 Mon Sep 17 00:00:00 2001 From: Pascal Quantin Date: Thu, 3 Dec 2015 21:32:25 +0100 Subject: Change codecs from static to dynamic library This allows to properly register codecs plugins. See https://www.wireshark.org/lists/wireshark-dev/201511/msg00202.html for details. Change-Id: Ibc13a19936abb7a2e81b86582a75fa424351565b Reviewed-on: https://code.wireshark.org/review/12385 Petri-Dish: Pascal Quantin Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris --- codecs/CMakeLists.txt | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) (limited to 'codecs/CMakeLists.txt') diff --git a/codecs/CMakeLists.txt b/codecs/CMakeLists.txt index 63ac64d08d..9f4d64a1b2 100644 --- a/codecs/CMakeLists.txt +++ b/codecs/CMakeLists.txt @@ -44,9 +44,38 @@ if(SBC_FOUND) set(CODECS_FILES ${CODECS_FILES} sbc/sbc.c) endif() -add_library(codecs STATIC +set(codecs_LIBS + ${GMODULE2_LIBRARIES} + wsutil +) + +add_library(codecs ${LINK_MODE_LIB} ${CODECS_FILES} + ${CMAKE_BINARY_DIR}/image/libwscodecs.rc ) + +set(FULL_SO_VERSION "0.0.0") + set_target_properties(codecs PROPERTIES - LINK_FLAGS "${WS_LINK_FLAGS}" - FOLDER "Libs") + PREFIX "libws" + COMPILE_DEFINITIONS "WS_BUILD_DLL" + LINK_FLAGS "${WS_LINK_FLAGS}" + VERSION ${FULL_SO_VERSION} SOVERSION 0 + FOLDER "Libs" +) + +if(ENABLE_APPLICATION_BUNDLE) + set_target_properties(codecs PROPERTIES + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/Frameworks + ) +endif() + +target_link_libraries(codecs ${codecs_LIBS}) + +if(NOT ${ENABLE_STATIC}) + install(TARGETS codecs + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + ) +endif() -- cgit v1.2.3