MXS-1413: Make the library dynamic

The static library cannot be linked to the Jansson static library by
CMake. This appears to be a limitation in CMake and a manual combination
of the two files would be required.

For the time being, the connector is only built as a shared library.
This commit is contained in:
Markus Mäkelä
2017-09-14 19:27:31 +03:00
parent 062a358077
commit 6b22865f7d

View File

@ -12,8 +12,8 @@ set(CMAKE_CXX_FLAGS_RELEASE "-fPIC -std=c++0x -O2")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-fPIC -std=c++0x -O2") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-fPIC -std=c++0x -O2")
include_directories(${JANSSON_INCLUDE_DIR}) include_directories(${JANSSON_INCLUDE_DIR})
add_library(cdc_connector STATIC cdc_connector.cpp) add_library(cdc_connector SHARED cdc_connector.cpp)
target_link_libraries(cdc_connector ${JANSSON_LIBRARIES}) target_link_libraries(cdc_connector ${JANSSON_LIBRARIES} crypto)
add_dependencies(cdc_connector jansson) add_dependencies(cdc_connector jansson)
install(TARGETS cdc_connector DESTINATION lib) install(TARGETS cdc_connector DESTINATION lib)
install(FILES cdc_connector.h DESTINATION include) install(FILES cdc_connector.h DESTINATION include)