Fix mysql includes and remove libmariadb submodule (#1185)

* Use bundled libmariadbclient (CLICKHOUSE-3261)

* wip

* wip

* wip

* Update docs about git clone. move docs/en/development/build_*.sh -> utils/build/build_debian.sh

* Fix mysql includes

* Cmake: don't install mariadb targets

* Fix generated includes

* Disable mysql tests

* cmake: mariadb fixes

* Fix

* Update find_mysqlclient.cmake

* Fix zlib

* Remove bundled contrib/mariadb-connector-c

* fix

* Fix build

* Fix includes
This commit is contained in:
proller 2017-09-04 20:04:33 +03:00 committed by alexey-milovidov
parent ea8790d077
commit f68a0ea63b
5 changed files with 20 additions and 41 deletions

3
.gitmodules vendored
View File

@ -1,3 +0,0 @@
[submodule "contrib/mariadb-connector-c"]
path = contrib/mariadb-connector-c
url = /MariaDB/mariadb-connector-c.git

View File

@ -63,8 +63,3 @@ endif ()
if (NOT ARCH_ARM)
add_subdirectory (libcpuid)
endif ()
if (USE_INTERNAL_MYSQL_LIBRARY)
add_subdirectory (mariadb-connector-c)
target_include_directories (${MYSQLCLIENT_LIBRARIES} BEFORE PUBLIC ${MYSQL_INCLUDE_DIR})
endif ()

@ -1 +0,0 @@
Subproject commit 35d6fb199611158109a898e695eca2564ef826fa

View File

@ -32,8 +32,11 @@ target_include_directories (mysqlxx PUBLIC include)
set(PLATFORM_LIBRARIES ${CMAKE_DL_LIBS})
if (USE_INTERNAL_MYSQL_LIBRARY)
elseif (USE_STATIC_LIBRARIES AND STATIC_MYSQLCLIENT_LIB)
if (USE_MYSQL)
include_directories (${MYSQL_INCLUDE_DIR})
endif ()
if (USE_STATIC_LIBRARIES AND STATIC_MYSQLCLIENT_LIB)
set (MYSQLCLIENT_LIB ${CMAKE_CURRENT_BINARY_DIR}/libmysqlclient.a)
add_custom_command (
OUTPUT ${MYSQLCLIENT_LIB}

View File

@ -1,15 +1,6 @@
option (ENABLE_MYSQL "Enable MySQL" ON)
option (USE_INTERNAL_MYSQL_LIBRARY "Set to FALSE to use system mysql library instead of bundled" ${NOT_UNBUNDLED})
if (ENABLE_MYSQL)
if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/mariadb-connector-c/CMakeLists.txt")
message (WARNING "submodule contrib/mariadb-connector-c is missing. to fix try run: git submodule update --init --recursive")
set (USE_INTERNAL_MYSQL_LIBRARY 0)
endif ()
if (NOT USE_INTERNAL_MYSQL_LIBRARY)
set (MYSQL_LIB_PATHS
"/usr/local/opt/mysql/lib"
"/usr/local/lib/mysql/"
@ -35,22 +26,16 @@ if (ENABLE_MYSQL)
else ()
find_library (MYSQLCLIENT_LIBRARIES mariadbclient mysqlclient PATHS ${MYSQL_LIB_PATHS})
endif ()
endif ()
if (MYSQL_INCLUDE_DIR AND (STATIC_MYSQLCLIENT_LIB OR MYSQLCLIENT_LIBRARIES))
include_directories (MYSQL_INCLUDE_DIR)
else ()
set (USE_INTERNAL_MYSQL_LIBRARY 1)
set (MYSQLCLIENT_LIBRARIES mariadbclient)
set (MYSQL_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/mariadb-connector-c/include")
set (USE_MYSQL 1)
endif ()
set(USE_MYSQL 1)
set (MYSQLXX_LIBRARY mysqlxx)
endif ()
if (USE_MYSQL)
message (STATUS "Using mysqlclient=${USE_MYSQL}: ${MYSQL_INCLUDE_DIR} : ${MYSQLCLIENT_LIBRARIES}; staticlib=${STATIC_MYSQLCLIENT_LIB} internal=${USE_INTERNAL_MYSQL_LIBRARY}")
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 ()