Make query classifier self-contained.

Only the query classifier needs the functionality of the embedded
server, while the rest of MaxScale is content with the client
library or Connector/C.

This have now been rearranged so that query-classifier links with
the embedded static library and then explicitly exports its own
functions using the query_classifier.map linker script. That way
query classifier will use the embedded library, while the rest of
maxscale use the client library, and this without conflicts.

Currently, query_classifier is not linked to maxscale-common,
but executables must link to maxscale-common and query_classifier.
This commit is contained in:
Johan Wikman
2016-01-15 16:26:56 +02:00
parent 0b742977dd
commit 42b1722e49
11 changed files with 126 additions and 35 deletions

View File

@ -1,6 +1,9 @@
add_library(query_classifier SHARED query_classifier.cc)
target_link_libraries(query_classifier maxscale-common)
target_link_libraries(query_classifier ${EMBEDDED_LIB} aio crypt crypto dl m ${PCRE_LINK_FLAGS} ssl stdc++ z)
set_target_properties(query_classifier PROPERTIES VERSION "1.0.0")
set_target_properties(query_classifier PROPERTIES LINK_FLAGS -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/query_classifier.map)
#set_target_properties(query_classifier PROPERTIES LINK_FLAGS -Wl,-z,defs)
install(TARGETS query_classifier COMPONENT lib DESTINATION ${MAXSCALE_LIBDIR})
if(BUILD_TESTS)
add_subdirectory(test)