mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 08:32:02 +00:00
Remove unbundled mysql support
This commit is contained in:
parent
17c45eb238
commit
a75b748fee
@ -489,9 +489,6 @@ include (GNUInstallDirs)
|
||||
include (cmake/find/llvm.cmake)
|
||||
include (cmake/find/nlp.cmake)
|
||||
|
||||
# Need to process before "contrib" dir:
|
||||
include (cmake/find/mysqlclient.cmake)
|
||||
|
||||
# When testing for memory leaks with Valgrind, don't link tcmalloc or jemalloc.
|
||||
|
||||
if (TARGET global-group)
|
||||
|
@ -1,78 +0,0 @@
|
||||
if(OS_LINUX AND TARGET OpenSSL::SSL)
|
||||
option(ENABLE_MYSQL "Enable MySQL" ${ENABLE_LIBRARIES})
|
||||
else ()
|
||||
option(ENABLE_MYSQL "Enable MySQL" FALSE)
|
||||
endif ()
|
||||
|
||||
if(NOT ENABLE_MYSQL)
|
||||
if (USE_INTERNAL_MYSQL_LIBRARY)
|
||||
message (${RECONFIGURE_MESSAGE_LEVEL} "Cannot use internal mysql library with ENABLE_MYSQL=OFF")
|
||||
endif ()
|
||||
message (STATUS "Build without mysqlclient (support for MYSQL dictionary source will be disabled)")
|
||||
return()
|
||||
endif()
|
||||
|
||||
option(USE_INTERNAL_MYSQL_LIBRARY "Set to FALSE to use system mysqlclient library instead of bundled" ON)
|
||||
|
||||
if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/mariadb-connector-c/README")
|
||||
if(USE_INTERNAL_MYSQL_LIBRARY)
|
||||
message(WARNING "submodule contrib/mariadb-connector-c is missing. to fix try run: \n git submodule update --init")
|
||||
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find internal mysql library")
|
||||
set(USE_INTERNAL_MYSQL_LIBRARY 0)
|
||||
endif()
|
||||
set(MISSING_INTERNAL_MYSQL_LIBRARY 1)
|
||||
endif()
|
||||
|
||||
if (NOT USE_INTERNAL_MYSQL_LIBRARY)
|
||||
set (MYSQL_LIB_PATHS
|
||||
"/usr/local/opt/mysql/lib"
|
||||
"/usr/local/lib"
|
||||
"/usr/local/lib64"
|
||||
"/usr/local/lib/mariadb" # macos brew mariadb-connector-c
|
||||
"/usr/mysql/lib"
|
||||
"/usr/mysql/lib64"
|
||||
"/usr/lib"
|
||||
"/usr/lib64"
|
||||
"/lib"
|
||||
"/lib64")
|
||||
|
||||
set (MYSQL_INCLUDE_PATHS
|
||||
"/usr/local/opt/mysql/include"
|
||||
"/usr/mysql/include"
|
||||
"/usr/local/include"
|
||||
"/usr/include/mariadb"
|
||||
"/usr/include/mysql"
|
||||
"/usr/include")
|
||||
|
||||
find_path (MYSQL_INCLUDE_DIR NAMES mysql.h mysql/mysql.h mariadb/mysql.h PATHS ${MYSQL_INCLUDE_PATHS} PATH_SUFFIXES mysql)
|
||||
|
||||
if (USE_STATIC_LIBRARIES)
|
||||
find_library (STATIC_MYSQLCLIENT_LIB NAMES mariadbclient mysqlclient PATHS ${MYSQL_LIB_PATHS} PATH_SUFFIXES mysql)
|
||||
else ()
|
||||
find_library (MYSQLCLIENT_LIBRARIES NAMES mariadb mariadbclient mysqlclient PATHS ${MYSQL_LIB_PATHS} PATH_SUFFIXES mysql)
|
||||
endif ()
|
||||
|
||||
if (MYSQL_INCLUDE_DIR AND (STATIC_MYSQLCLIENT_LIB OR MYSQLCLIENT_LIBRARIES))
|
||||
set (USE_MYSQL 1)
|
||||
set (MYSQLXX_LIBRARY mysqlxx)
|
||||
if (APPLE)
|
||||
# /usr/local/include/mysql/mysql_com.h:1011:10: fatal error: mysql/udf_registration_types.h: No such file or directory
|
||||
set(MYSQL_INCLUDE_DIR ${MYSQL_INCLUDE_DIR} ${MYSQL_INCLUDE_DIR}/mysql)
|
||||
endif ()
|
||||
else ()
|
||||
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find system mysql library")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if (NOT USE_MYSQL AND NOT MISSING_INTERNAL_MYSQL_LIBRARY)
|
||||
set (MYSQLCLIENT_LIBRARIES mariadbclient)
|
||||
set (MYSQLXX_LIBRARY mysqlxx)
|
||||
set (USE_MYSQL 1)
|
||||
set (USE_INTERNAL_MYSQL_LIBRARY 1)
|
||||
endif()
|
||||
|
||||
if (USE_MYSQL)
|
||||
message (STATUS "Using mysqlclient=${USE_MYSQL}: ${MYSQL_INCLUDE_DIR} : ${MYSQLCLIENT_LIBRARIES}; staticlib=${STATIC_MYSQLCLIENT_LIB}")
|
||||
else ()
|
||||
message (STATUS "Build without mysqlclient (support for MYSQL dictionary source will be disabled)")
|
||||
endif ()
|
7
contrib/CMakeLists.txt
vendored
7
contrib/CMakeLists.txt
vendored
@ -75,12 +75,7 @@ add_subdirectory (cityhash102)
|
||||
add_subdirectory (libfarmhash)
|
||||
add_subdirectory (icu-cmake)
|
||||
add_subdirectory (h3-cmake)
|
||||
|
||||
# TODO: refactor the contrib libraries below this comment.
|
||||
|
||||
if (USE_INTERNAL_MYSQL_LIBRARY)
|
||||
add_subdirectory (mariadb-connector-c-cmake)
|
||||
endif ()
|
||||
add_subdirectory (mariadb-connector-c-cmake)
|
||||
|
||||
if (ENABLE_TESTS)
|
||||
add_subdirectory (googletest-cmake)
|
||||
|
@ -1,3 +1,14 @@
|
||||
if(OS_LINUX AND TARGET OpenSSL::SSL)
|
||||
option(ENABLE_MYSQL "Enable MySQL" ${ENABLE_LIBRARIES})
|
||||
else ()
|
||||
option(ENABLE_MYSQL "Enable MySQL" FALSE)
|
||||
endif ()
|
||||
|
||||
if(NOT ENABLE_MYSQL)
|
||||
message (STATUS "Build without mysqlclient (support for MYSQL dictionary source will be disabled)")
|
||||
return()
|
||||
endif()
|
||||
|
||||
if (GLIBC_COMPATIBILITY)
|
||||
set(LIBM glibc-compatibility)
|
||||
endif()
|
||||
@ -235,3 +246,5 @@ target_include_directories(mariadbclient PRIVATE ${CC_BINARY_DIR}/include-privat
|
||||
target_include_directories(mariadbclient SYSTEM PUBLIC ${CC_BINARY_DIR}/include-public ${CC_SOURCE_DIR}/include ${CC_SOURCE_DIR}/libmariadb)
|
||||
|
||||
set_target_properties(mariadbclient PROPERTIES IMPORTED_INTERFACE_LINK_LIBRARIES "${SYSTEM_LIBS}")
|
||||
|
||||
add_library(ch_contrib::mariadbclient ALIAS mariadbclient)
|
||||
|
@ -366,11 +366,14 @@ dbms_target_link_libraries (
|
||||
Poco::MongoDB
|
||||
string_utils
|
||||
PUBLIC
|
||||
${MYSQLXX_LIBRARY}
|
||||
boost::system
|
||||
clickhouse_common_io
|
||||
)
|
||||
|
||||
if (TARGET ch::mysqlxx)
|
||||
dbms_target_link_libraries (PUBLIC ch::mysqlxx)
|
||||
endif()
|
||||
|
||||
dbms_target_link_libraries (
|
||||
PUBLIC
|
||||
boost::circular_buffer
|
||||
|
@ -4,6 +4,6 @@ if (ENABLE_EXAMPLES)
|
||||
add_subdirectory(examples)
|
||||
endif()
|
||||
|
||||
if (USE_MYSQL)
|
||||
if (ENABLE_MYSQL)
|
||||
add_subdirectory (mysqlxx)
|
||||
endif ()
|
||||
|
@ -15,10 +15,12 @@ target_include_directories (mysqlxx PUBLIC .)
|
||||
|
||||
target_link_libraries (mysqlxx
|
||||
clickhouse_common_io
|
||||
${MYSQLCLIENT_LIBRARIES}
|
||||
ch_contrib::zlib
|
||||
ch_contrib::mariadbclient
|
||||
)
|
||||
|
||||
add_library(ch::mysqlxx ALIAS mysqlxx)
|
||||
|
||||
if (ENABLE_TESTS)
|
||||
add_subdirectory (tests)
|
||||
endif ()
|
||||
|
@ -2,4 +2,7 @@ include("${ClickHouse_SOURCE_DIR}/cmake/dbms_glob_sources.cmake")
|
||||
add_headers_and_sources(clickhouse_dictionaries_embedded .)
|
||||
add_headers_and_sources(clickhouse_dictionaries_embedded GeodataProviders)
|
||||
add_library(clickhouse_dictionaries_embedded ${clickhouse_dictionaries_embedded_sources})
|
||||
target_link_libraries(clickhouse_dictionaries_embedded PRIVATE clickhouse_common_io ${MYSQLXX_LIBRARY})
|
||||
target_link_libraries(clickhouse_dictionaries_embedded PRIVATE clickhouse_common_io)
|
||||
if (TARGET ch::mysqlxx)
|
||||
target_link_libraries(clickhouse_dictionaries_embedded PRIVATE ch::mysqlxx)
|
||||
endif()
|
||||
|
@ -76,3 +76,6 @@ endif()
|
||||
if (TARGET ch_contrib::aws_s3)
|
||||
set(USE_AWS_S3 1)
|
||||
endif()
|
||||
if (TARGET ch_contrib::mariadbclient) # ch::mysqlxx
|
||||
set(USE_MYSQL 1)
|
||||
endif()
|
||||
|
Loading…
Reference in New Issue
Block a user