ClickHouse/contrib/mariadb-connector-c-cmake/CMakeLists.txt
proller 77bd2624ea Build fixes (#6016)
* Fix building without submodules

* Fix more gcc9 warnings

* was wrong!
../dbms/src/IO/WriteBufferAIO.cpp:277:54: error: result of comparison 'ssize_t' (aka 'long') > 9223372036854775807 is always false [-Werror,-Wtautological-type-limit-compare]
    if ((static_cast<ssize_t>(flush_buffer.offset()) > std::numeric_limits<off_t>::max()) ||
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

* mimalloc off MI_OVERRIDE

* Fix freebsd build

* Fix shared build

* Fix build in gcc9

* Fix split build

* fix

* fix

* fix

* fix

* clean

* zstd

* Update CMakeLists.txt

* Update Defines.h

* Try fix -Wsign-compare

* Freebsd fix

* Add missing libs

* Fix double-conversion include for copy-headers

* Fix zlib link

* Fix includes for arcadia

* Fix includes for arcadia

* Fix includes for arcadia

* Freebsd fix

* Arcadia fixes

* Update QueryProfiler.cpp

* Freebsd fix

* clean

* 19.11: Fixes for arcadia porting (#6223)

* fix glibc-compatibility

* M_LIBRARY fix

* wip

* Fix

* Fix arm build

* unwind fix

* Update CMakeLists.txt
2019-08-04 03:19:03 +03:00

78 lines
3.6 KiB
CMake

set(MARIADB_CLIENT_SOURCE_DIR ${ClickHouse_SOURCE_DIR}/contrib/mariadb-connector-c)
set(MARIADB_CLIENT_BINARY_DIR ${ClickHouse_BINARY_DIR}/contrib/mariadb-connector-c)
set(SRCS
#${MARIADB_CLIENT_SOURCE_DIR}/libmariadb/bmove_upp.c
${MARIADB_CLIENT_SOURCE_DIR}/libmariadb/get_password.c
${MARIADB_CLIENT_SOURCE_DIR}/libmariadb/ma_alloc.c
${MARIADB_CLIENT_SOURCE_DIR}/libmariadb/ma_array.c
${MARIADB_CLIENT_SOURCE_DIR}/libmariadb/ma_charset.c
${MARIADB_CLIENT_SOURCE_DIR}/libmariadb/ma_compress.c
${MARIADB_CLIENT_SOURCE_DIR}/libmariadb/ma_context.c
${MARIADB_CLIENT_SOURCE_DIR}/libmariadb/ma_default.c
${MARIADB_CLIENT_SOURCE_DIR}/libmariadb/ma_dtoa.c
${MARIADB_CLIENT_SOURCE_DIR}/libmariadb/ma_errmsg.c
${MARIADB_CLIENT_SOURCE_DIR}/libmariadb/ma_hash.c
${MARIADB_CLIENT_SOURCE_DIR}/libmariadb/ma_init.c
${MARIADB_CLIENT_SOURCE_DIR}/libmariadb/ma_io.c
${MARIADB_CLIENT_SOURCE_DIR}/libmariadb/ma_list.c
${MARIADB_CLIENT_SOURCE_DIR}/libmariadb/ma_ll2str.c
${MARIADB_CLIENT_SOURCE_DIR}/libmariadb/ma_loaddata.c
${MARIADB_CLIENT_SOURCE_DIR}/libmariadb/ma_net.c
${MARIADB_CLIENT_SOURCE_DIR}/libmariadb/ma_password.c
${MARIADB_CLIENT_SOURCE_DIR}/libmariadb/ma_pvio.c
${MARIADB_CLIENT_SOURCE_DIR}/libmariadb/mariadb_async.c
${MARIADB_CLIENT_SOURCE_DIR}/libmariadb/mariadb_charset.c
#${MARIADB_CLIENT_SOURCE_DIR}/libmariadb/mariadb_dyncol.c
${MARIADB_CLIENT_SOURCE_DIR}/libmariadb/mariadb_lib.c
${MARIADB_CLIENT_SOURCE_DIR}/libmariadb/mariadb_stmt.c
${MARIADB_CLIENT_SOURCE_DIR}/libmariadb/ma_sha1.c
${MARIADB_CLIENT_SOURCE_DIR}/libmariadb/ma_stmt_codec.c
${MARIADB_CLIENT_SOURCE_DIR}/libmariadb/ma_string.c
${MARIADB_CLIENT_SOURCE_DIR}/libmariadb/ma_time.c
${MARIADB_CLIENT_SOURCE_DIR}/libmariadb/ma_tls.c
#${MARIADB_CLIENT_SOURCE_DIR}/libmariadb/secure/gnutls.c
#${MARIADB_CLIENT_SOURCE_DIR}/libmariadb/secure/ma_schannel.c
#${MARIADB_CLIENT_SOURCE_DIR}/libmariadb/secure/schannel.c
#${MARIADB_CLIENT_SOURCE_DIR}/plugins/auth/auth_gssapi_client.c
#${MARIADB_CLIENT_SOURCE_DIR}/plugins/auth/dialog.c
#${MARIADB_CLIENT_SOURCE_DIR}/plugins/auth/gssapi_client.c
#${MARIADB_CLIENT_SOURCE_DIR}/plugins/auth/gssapi_errmsg.c
${MARIADB_CLIENT_SOURCE_DIR}/plugins/auth/mariadb_cleartext.c
${MARIADB_CLIENT_SOURCE_DIR}/plugins/auth/my_auth.c
${MARIADB_CLIENT_SOURCE_DIR}/plugins/auth/old_password.c
${MARIADB_CLIENT_SOURCE_DIR}/plugins/auth/sha256_pw.c
#${MARIADB_CLIENT_SOURCE_DIR}/plugins/auth/sspi_client.c
#${MARIADB_CLIENT_SOURCE_DIR}/plugins/auth/sspi_errmsg.c
${MARIADB_CLIENT_SOURCE_DIR}/plugins/connection/aurora.c
${MARIADB_CLIENT_SOURCE_DIR}/plugins/connection/replication.c
#${MARIADB_CLIENT_SOURCE_DIR}/plugins/io/remote_io.c
#${MARIADB_CLIENT_SOURCE_DIR}/plugins/pvio/pvio_npipe.c
#${MARIADB_CLIENT_SOURCE_DIR}/plugins/pvio/pvio_shmem.c
${MARIADB_CLIENT_SOURCE_DIR}/plugins/pvio/pvio_socket.c
#${MARIADB_CLIENT_SOURCE_DIR}/plugins/trace/trace_example.c
${CMAKE_CURRENT_SOURCE_DIR}/linux_x86_64/libmariadb/ma_client_plugin.c
)
if(OPENSSL_LIBRARIES)
list(APPEND SRCS ${MARIADB_CLIENT_SOURCE_DIR}/libmariadb/secure/openssl.c)
endif()
add_library(mysqlclient ${SRCS})
target_link_libraries(mysqlclient PRIVATE ${CMAKE_DL_LIBS} Threads::Threads)
if(M_LIBRARY)
target_link_libraries(mysqlclient PRIVATE ${M_LIBRARY})
endif()
if(OPENSSL_LIBRARIES)
target_link_libraries(mysqlclient PRIVATE ${OPENSSL_LIBRARIES})
target_compile_definitions(mysqlclient PRIVATE -D HAVE_OPENSSL -D HAVE_TLS)
endif()
target_include_directories(mysqlclient PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/linux_x86_64/include)
target_include_directories(mysqlclient PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/common/include)
target_include_directories(mysqlclient PUBLIC ${MARIADB_CLIENT_SOURCE_DIR}/include)
target_compile_definitions(mysqlclient PRIVATE -D THREAD)