1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-01 06:46:55 +03:00

fix C API includes

ColumnStore used to include server's mysql.h
but link all tools with libmariadb.so

There's no guarantee that this would work, even with workarounds
it had in dbcon/mysql/sm.cpp

Fix:
* tools (linked with libmariadb.so) *must* include libmariadb's mysql.h
* as a hack prevent service_thd_timezone.h from being loaded into tools,
  as it conflicts with libmariadb's mysql.h
* server plugin *must* include server's mysql.h
* also don't link every tool with libmariadb.so, link the helper library
  (liblibmysqlclient.so) that actually needs it, tools use this
  helper library, not libmariadb.so directly
This commit is contained in:
Sergei Golubchik
2022-09-04 20:26:41 +02:00
parent 76dbbd031b
commit d31b669995
29 changed files with 46 additions and 102 deletions

View File

@ -1,4 +1,9 @@
include_directories(BEFORE
${CMAKE_BINARY_DIR}/libmariadb/include
${CMAKE_SOURCE_DIR}/libmariadb/include)
add_definitions(-DMYSQL_SERVICE_THD_TIMEZONE_INCLUDED)
include_directories( ${ENGINE_COMMON_INCLUDES} )
########### next target ###############
@ -6,6 +11,7 @@ include_directories( ${ENGINE_COMMON_INCLUDES} )
set(libmysql_client_LIB_SRCS libmysql_client.cpp)
add_library(libmysql_client SHARED ${libmysql_client_LIB_SRCS})
target_link_libraries(libmysql_client ${MARIADB_CLIENT_LIBS})
add_dependencies(libmysql_client loggingcpp)