cmake: disabling silent reconfigurations in contrib/*/CMakeLists.txt

Signed-off-by: Konstantin Podshumok <kpp.live+signed@gmail.com>
This commit is contained in:
Konstantin Podshumok 2020-08-09 21:31:00 +03:00
parent d22de6c7e9
commit 262080132b
12 changed files with 1126 additions and 995 deletions

View File

@ -80,7 +80,7 @@ set(FLATBUFFERS_BINARY_DIR ${ClickHouse_BINARY_DIR}/contrib/flatbuffers)
set(FLATBUFFERS_INCLUDE_DIR ${FLATBUFFERS_SRC_DIR}/include) set(FLATBUFFERS_INCLUDE_DIR ${FLATBUFFERS_SRC_DIR}/include)
# set flatbuffers CMake options # set flatbuffers CMake options
if (${USE_STATIC_LIBRARIES}) if (MAKE_STATIC_LIBRARIES)
set(FLATBUFFERS_BUILD_FLATLIB ON CACHE BOOL "Enable the build of the flatbuffers library") set(FLATBUFFERS_BUILD_FLATLIB ON CACHE BOOL "Enable the build of the flatbuffers library")
set(FLATBUFFERS_BUILD_SHAREDLIB OFF CACHE BOOL "Disable the build of the flatbuffers shared library") set(FLATBUFFERS_BUILD_SHAREDLIB OFF CACHE BOOL "Disable the build of the flatbuffers shared library")
else () else ()

View File

@ -1,6 +1,52 @@
option (USE_INTERNAL_BOOST_LIBRARY "Use internal Boost library" ${NOT_UNBUNDLED}) option (USE_INTERNAL_BOOST_LIBRARY "Use internal Boost library" ${NOT_UNBUNDLED})
if (USE_INTERNAL_BOOST_LIBRARY) if (NOT USE_INTERNAL_BOOST_LIBRARY)
# 1.70 like in contrib/boost
# 1.67 on CI
set(BOOST_VERSION 1.67)
find_package(Boost ${BOOST_VERSION} COMPONENTS
system
filesystem
iostreams
program_options
regex
)
if(Boost_INCLUDE_DIR AND Boost_FILESYSTEM_LIBRARY AND Boost_FILESYSTEM_LIBRARY AND
Boost_PROGRAM_OPTIONS_LIBRARY AND Boost_REGEX_LIBRARY AND Boost_SYSTEM_LIBRARY)
set(EXTERNAL_BOOST_FOUND 1)
add_library (_boost_headers_only INTERFACE)
add_library (boost::headers_only ALIAS _boost_headers_only)
target_include_directories (_boost_headers_only SYSTEM BEFORE INTERFACE ${Boost_INCLUDE_DIR})
add_library (_boost_filesystem INTERFACE)
add_library (_boost_iostreams INTERFACE)
add_library (_boost_program_options INTERFACE)
add_library (_boost_regex INTERFACE)
add_library (_boost_system INTERFACE)
target_link_libraries (_boost_filesystem INTERFACE ${Boost_FILESYSTEM_LIBRARY})
target_link_libraries (_boost_iostreams INTERFACE ${Boost_IOSTREAMS_LIBRARY})
target_link_libraries (_boost_program_options INTERFACE ${Boost_PROGRAM_OPTIONS_LIBRARY})
target_link_libraries (_boost_regex INTERFACE ${Boost_REGEX_LIBRARY})
target_link_libraries (_boost_system INTERFACE ${Boost_SYSTEM_LIBRARY})
add_library (boost::filesystem ALIAS _boost_filesystem)
add_library (boost::iostreams ALIAS _boost_iostreams)
add_library (boost::program_options ALIAS _boost_program_options)
add_library (boost::regex ALIAS _boost_regex)
add_library (boost::system ALIAS _boost_system)
else()
set(EXTERNAL_BOOST_FOUND 0)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find system boost")
endif()
endif()
if (NOT EXTERNAL_BOOST_FOUND)
set (USE_INTERNAL_BOOST_LIBRARY 1)
set (LIBRARY_DIR ${ClickHouse_SOURCE_DIR}/contrib/boost) set (LIBRARY_DIR ${ClickHouse_SOURCE_DIR}/contrib/boost)
# filesystem # filesystem
@ -96,38 +142,4 @@ if (USE_INTERNAL_BOOST_LIBRARY)
add_library (_boost_system ${SRCS_SYSTEM}) add_library (_boost_system ${SRCS_SYSTEM})
add_library (boost::system ALIAS _boost_system) add_library (boost::system ALIAS _boost_system)
target_include_directories (_boost_system PRIVATE ${LIBRARY_DIR}) target_include_directories (_boost_system PRIVATE ${LIBRARY_DIR})
else ()
# 1.70 like in contrib/boost
# 1.67 on CI
set(BOOST_VERSION 1.67)
find_package(Boost ${BOOST_VERSION} COMPONENTS
system
filesystem
iostreams
program_options
regex
REQUIRED)
add_library (_boost_headers_only INTERFACE)
add_library (boost::headers_only ALIAS _boost_headers_only)
target_include_directories (_boost_headers_only SYSTEM BEFORE INTERFACE ${Boost_INCLUDE_DIR})
add_library (_boost_filesystem INTERFACE)
add_library (_boost_iostreams INTERFACE)
add_library (_boost_program_options INTERFACE)
add_library (_boost_regex INTERFACE)
add_library (_boost_system INTERFACE)
target_link_libraries (_boost_filesystem INTERFACE ${Boost_FILESYSTEM_LIBRARY})
target_link_libraries (_boost_iostreams INTERFACE ${Boost_IOSTREAMS_LIBRARY})
target_link_libraries (_boost_program_options INTERFACE ${Boost_PROGRAM_OPTIONS_LIBRARY})
target_link_libraries (_boost_regex INTERFACE ${Boost_REGEX_LIBRARY})
target_link_libraries (_boost_system INTERFACE ${Boost_SYSTEM_LIBRARY})
add_library (boost::filesystem ALIAS _boost_filesystem)
add_library (boost::iostreams ALIAS _boost_iostreams)
add_library (boost::program_options ALIAS _boost_program_options)
add_library (boost::regex ALIAS _boost_regex)
add_library (boost::system ALIAS _boost_system)
endif () endif ()

View File

@ -1,9 +1,42 @@
option (USE_INTERNAL_CCTZ "Use internal cctz library" ${NOT_UNBUNDLED}) option (USE_INTERNAL_CCTZ_LIBRARY "Use internal cctz library" ${NOT_UNBUNDLED})
if (USE_INTERNAL_CCTZ) if (NOT USE_INTERNAL_CCTZ_LIBRARY)
SET(LIBRARY_DIR ${ClickHouse_SOURCE_DIR}/contrib/cctz) find_library (LIBRARY_CCTZ cctz)
find_path (INCLUDE_CCTZ NAMES cctz/civil_time.h)
SET (SRCS if (LIBRARY_CCTZ AND INCLUDE_CCTZ)
set (EXTERNAL_CCTZ_LIBRARY_FOUND 1)
set(CMAKE_REQUIRED_LIBRARIES ${LIBRARY_CCTZ})
set(CMAKE_REQUIRED_INCLUDES ${INCLUDE_CCTZ})
check_cxx_source_compiles(
"
#include <cctz/civil_time.h>
int main() {
cctz::civil_day date;
}
"
EXTERNAL_CCTZ_LIBRARY_WORKS
)
if (NOT EXTERNAL_CCTZ_LIBRARY_WORKS)
message (${RECONFIGURE_MESSAGE_LEVEL} "External cctz is not working: ${LIBRARY_CCTZ} ${INCLUDE_CCTZ}")
else()
add_library (cctz UNKNOWN IMPORTED)
set_property (TARGET cctz PROPERTY IMPORTED_LOCATION ${LIBRARY_CCTZ})
set_property (TARGET cctz PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${INCLUDE_CCTZ})
endif()
else()
set (EXTERNAL_CCTZ_LIBRARY_FOUND 0)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find system cctz")
endif()
endif()
if (NOT EXTERNAL_CCTZ_LIBRARY_FOUND OR NOT EXTERNAL_CCTZ_LIBRARY_WORKS)
set(USE_INTERNAL_CCTZ_LIBRARY 1)
set(LIBRARY_DIR ${ClickHouse_SOURCE_DIR}/contrib/cctz)
set (SRCS
${LIBRARY_DIR}/src/civil_time_detail.cc ${LIBRARY_DIR}/src/civil_time_detail.cc
${LIBRARY_DIR}/src/time_zone_fixed.cc ${LIBRARY_DIR}/src/time_zone_fixed.cc
${LIBRARY_DIR}/src/time_zone_format.cc ${LIBRARY_DIR}/src/time_zone_format.cc
@ -618,29 +651,6 @@ if (USE_INTERNAL_CCTZ)
add_dependencies(cctz tzdata) add_dependencies(cctz tzdata)
target_link_libraries(cctz INTERFACE "-Wl,--whole-archive $<TARGET_FILE:tzdata> -Wl,--no-whole-archive") target_link_libraries(cctz INTERFACE "-Wl,--whole-archive $<TARGET_FILE:tzdata> -Wl,--no-whole-archive")
endif () endif ()
else ()
find_library (LIBRARY_CCTZ cctz)
find_path (INCLUDE_CCTZ NAMES cctz/civil_time.h)
add_library (cctz UNKNOWN IMPORTED)
set_property (TARGET cctz PROPERTY IMPORTED_LOCATION ${LIBRARY_CCTZ})
set_property (TARGET cctz PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${INCLUDE_CCTZ})
set(CMAKE_REQUIRED_LIBRARIES cctz)
check_cxx_source_compiles(
"
#include <cctz/civil_time.h>
int main() {
cctz::civil_day date;
}
"
EXTERNAL_CCTZ_WORKS
)
if (NOT EXTERNAL_CCTZ_WORKS)
message (FATAL_ERROR "cctz is unusable: ${LIBRARY_CCTZ} ${INCLUDE_CCTZ}")
endif ()
endif () endif ()
message (STATUS "Using cctz") message (STATUS "Using cctz")

View File

@ -1,187 +1,200 @@
option (ENABLE_CURL "Enable curl" ${ENABLE_LIBRARIES}) option (ENABLE_CURL "Enable curl" ${ENABLE_LIBRARIES})
if (ENABLE_CURL) if (NOT ENABLE_CURL)
option (USE_INTERNAL_CURL "Use internal curl library" ${NOT_UNBUNDLED})
if (USE_INTERNAL_CURL) if (USE_INTERNAL_CURL)
set (LIBRARY_DIR "${ClickHouse_SOURCE_DIR}/contrib/curl") message (${RECONFIGURE_MESSAGE_LEVEL} "Can't use internal curl with ENABLE_CURL=OFF")
endif()
return()
endif()
set (SRCS option (USE_INTERNAL_CURL "Use internal curl library" ${NOT_UNBUNDLED})
${LIBRARY_DIR}/lib/file.c
${LIBRARY_DIR}/lib/timeval.c
${LIBRARY_DIR}/lib/base64.c
${LIBRARY_DIR}/lib/hostip.c
${LIBRARY_DIR}/lib/progress.c
${LIBRARY_DIR}/lib/formdata.c
${LIBRARY_DIR}/lib/cookie.c
${LIBRARY_DIR}/lib/http.c
${LIBRARY_DIR}/lib/sendf.c
${LIBRARY_DIR}/lib/url.c
${LIBRARY_DIR}/lib/dict.c
${LIBRARY_DIR}/lib/if2ip.c
${LIBRARY_DIR}/lib/speedcheck.c
${LIBRARY_DIR}/lib/ldap.c
${LIBRARY_DIR}/lib/version.c
${LIBRARY_DIR}/lib/getenv.c
${LIBRARY_DIR}/lib/escape.c
${LIBRARY_DIR}/lib/mprintf.c
${LIBRARY_DIR}/lib/telnet.c
${LIBRARY_DIR}/lib/netrc.c
${LIBRARY_DIR}/lib/getinfo.c
${LIBRARY_DIR}/lib/transfer.c
${LIBRARY_DIR}/lib/strcase.c
${LIBRARY_DIR}/lib/easy.c
${LIBRARY_DIR}/lib/security.c
${LIBRARY_DIR}/lib/curl_fnmatch.c
${LIBRARY_DIR}/lib/fileinfo.c
${LIBRARY_DIR}/lib/wildcard.c
${LIBRARY_DIR}/lib/krb5.c
${LIBRARY_DIR}/lib/memdebug.c
${LIBRARY_DIR}/lib/http_chunks.c
${LIBRARY_DIR}/lib/strtok.c
${LIBRARY_DIR}/lib/connect.c
${LIBRARY_DIR}/lib/llist.c
${LIBRARY_DIR}/lib/hash.c
${LIBRARY_DIR}/lib/multi.c
${LIBRARY_DIR}/lib/content_encoding.c
${LIBRARY_DIR}/lib/share.c
${LIBRARY_DIR}/lib/http_digest.c
${LIBRARY_DIR}/lib/md4.c
${LIBRARY_DIR}/lib/md5.c
${LIBRARY_DIR}/lib/http_negotiate.c
${LIBRARY_DIR}/lib/inet_pton.c
${LIBRARY_DIR}/lib/strtoofft.c
${LIBRARY_DIR}/lib/strerror.c
${LIBRARY_DIR}/lib/amigaos.c
${LIBRARY_DIR}/lib/hostasyn.c
${LIBRARY_DIR}/lib/hostip4.c
${LIBRARY_DIR}/lib/hostip6.c
${LIBRARY_DIR}/lib/hostsyn.c
${LIBRARY_DIR}/lib/inet_ntop.c
${LIBRARY_DIR}/lib/parsedate.c
${LIBRARY_DIR}/lib/select.c
${LIBRARY_DIR}/lib/splay.c
${LIBRARY_DIR}/lib/strdup.c
${LIBRARY_DIR}/lib/socks.c
${LIBRARY_DIR}/lib/curl_addrinfo.c
${LIBRARY_DIR}/lib/socks_gssapi.c
${LIBRARY_DIR}/lib/socks_sspi.c
${LIBRARY_DIR}/lib/curl_sspi.c
${LIBRARY_DIR}/lib/slist.c
${LIBRARY_DIR}/lib/nonblock.c
${LIBRARY_DIR}/lib/curl_memrchr.c
${LIBRARY_DIR}/lib/imap.c
${LIBRARY_DIR}/lib/pop3.c
${LIBRARY_DIR}/lib/smtp.c
${LIBRARY_DIR}/lib/pingpong.c
${LIBRARY_DIR}/lib/rtsp.c
${LIBRARY_DIR}/lib/curl_threads.c
${LIBRARY_DIR}/lib/warnless.c
${LIBRARY_DIR}/lib/hmac.c
${LIBRARY_DIR}/lib/curl_rtmp.c
${LIBRARY_DIR}/lib/openldap.c
${LIBRARY_DIR}/lib/curl_gethostname.c
${LIBRARY_DIR}/lib/gopher.c
${LIBRARY_DIR}/lib/idn_win32.c
${LIBRARY_DIR}/lib/http_proxy.c
${LIBRARY_DIR}/lib/non-ascii.c
${LIBRARY_DIR}/lib/asyn-thread.c
${LIBRARY_DIR}/lib/curl_gssapi.c
${LIBRARY_DIR}/lib/http_ntlm.c
${LIBRARY_DIR}/lib/curl_ntlm_wb.c
${LIBRARY_DIR}/lib/curl_ntlm_core.c
${LIBRARY_DIR}/lib/curl_sasl.c
${LIBRARY_DIR}/lib/rand.c
${LIBRARY_DIR}/lib/curl_multibyte.c
${LIBRARY_DIR}/lib/hostcheck.c
${LIBRARY_DIR}/lib/conncache.c
${LIBRARY_DIR}/lib/dotdot.c
${LIBRARY_DIR}/lib/x509asn1.c
${LIBRARY_DIR}/lib/http2.c
${LIBRARY_DIR}/lib/smb.c
${LIBRARY_DIR}/lib/curl_endian.c
${LIBRARY_DIR}/lib/curl_des.c
${LIBRARY_DIR}/lib/system_win32.c
${LIBRARY_DIR}/lib/mime.c
${LIBRARY_DIR}/lib/sha256.c
${LIBRARY_DIR}/lib/setopt.c
${LIBRARY_DIR}/lib/curl_path.c
${LIBRARY_DIR}/lib/curl_ctype.c
${LIBRARY_DIR}/lib/curl_range.c
${LIBRARY_DIR}/lib/psl.c
${LIBRARY_DIR}/lib/doh.c
${LIBRARY_DIR}/lib/urlapi.c
${LIBRARY_DIR}/lib/curl_get_line.c
${LIBRARY_DIR}/lib/altsvc.c
${LIBRARY_DIR}/lib/socketpair.c
${LIBRARY_DIR}/lib/vauth/vauth.c
${LIBRARY_DIR}/lib/vauth/cleartext.c
${LIBRARY_DIR}/lib/vauth/cram.c
${LIBRARY_DIR}/lib/vauth/digest.c
${LIBRARY_DIR}/lib/vauth/digest_sspi.c
${LIBRARY_DIR}/lib/vauth/krb5_gssapi.c
${LIBRARY_DIR}/lib/vauth/krb5_sspi.c
${LIBRARY_DIR}/lib/vauth/ntlm.c
${LIBRARY_DIR}/lib/vauth/ntlm_sspi.c
${LIBRARY_DIR}/lib/vauth/oauth2.c
${LIBRARY_DIR}/lib/vauth/spnego_gssapi.c
${LIBRARY_DIR}/lib/vauth/spnego_sspi.c
${LIBRARY_DIR}/lib/vtls/openssl.c
${LIBRARY_DIR}/lib/vtls/gtls.c
${LIBRARY_DIR}/lib/vtls/vtls.c
${LIBRARY_DIR}/lib/vtls/nss.c
${LIBRARY_DIR}/lib/vtls/polarssl.c
${LIBRARY_DIR}/lib/vtls/polarssl_threadlock.c
${LIBRARY_DIR}/lib/vtls/wolfssl.c
${LIBRARY_DIR}/lib/vtls/schannel.c
${LIBRARY_DIR}/lib/vtls/schannel_verify.c
${LIBRARY_DIR}/lib/vtls/sectransp.c
${LIBRARY_DIR}/lib/vtls/gskit.c
${LIBRARY_DIR}/lib/vtls/mbedtls.c
${LIBRARY_DIR}/lib/vtls/mesalink.c
${LIBRARY_DIR}/lib/vtls/bearssl.c
${LIBRARY_DIR}/lib/vquic/ngtcp2.c
${LIBRARY_DIR}/lib/vquic/quiche.c
${LIBRARY_DIR}/lib/vssh/libssh2.c
${LIBRARY_DIR}/lib/vssh/libssh.c
)
add_library (curl ${SRCS}) if (NOT USE_INTERNAL_CURL)
find_package (CURL)
if (NOT CURL_FOUND)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find system curl")
endif()
endif()
target_compile_definitions (curl PRIVATE if (NOT CURL_FOUND)
HAVE_CONFIG_H set (USE_INTERNAL_CURL 1)
BUILDING_LIBCURL set (LIBRARY_DIR "${ClickHouse_SOURCE_DIR}/contrib/curl")
CURL_HIDDEN_SYMBOLS
libcurl_EXPORTS
OS="${CMAKE_SYSTEM_NAME}"
)
target_include_directories (curl PUBLIC
${LIBRARY_DIR}/include
${LIBRARY_DIR}/lib
. # curl_config.h
)
target_link_libraries (curl PRIVATE ssl) set (SRCS
${LIBRARY_DIR}/lib/file.c
${LIBRARY_DIR}/lib/timeval.c
${LIBRARY_DIR}/lib/base64.c
${LIBRARY_DIR}/lib/hostip.c
${LIBRARY_DIR}/lib/progress.c
${LIBRARY_DIR}/lib/formdata.c
${LIBRARY_DIR}/lib/cookie.c
${LIBRARY_DIR}/lib/http.c
${LIBRARY_DIR}/lib/sendf.c
${LIBRARY_DIR}/lib/url.c
${LIBRARY_DIR}/lib/dict.c
${LIBRARY_DIR}/lib/if2ip.c
${LIBRARY_DIR}/lib/speedcheck.c
${LIBRARY_DIR}/lib/ldap.c
${LIBRARY_DIR}/lib/version.c
${LIBRARY_DIR}/lib/getenv.c
${LIBRARY_DIR}/lib/escape.c
${LIBRARY_DIR}/lib/mprintf.c
${LIBRARY_DIR}/lib/telnet.c
${LIBRARY_DIR}/lib/netrc.c
${LIBRARY_DIR}/lib/getinfo.c
${LIBRARY_DIR}/lib/transfer.c
${LIBRARY_DIR}/lib/strcase.c
${LIBRARY_DIR}/lib/easy.c
${LIBRARY_DIR}/lib/security.c
${LIBRARY_DIR}/lib/curl_fnmatch.c
${LIBRARY_DIR}/lib/fileinfo.c
${LIBRARY_DIR}/lib/wildcard.c
${LIBRARY_DIR}/lib/krb5.c
${LIBRARY_DIR}/lib/memdebug.c
${LIBRARY_DIR}/lib/http_chunks.c
${LIBRARY_DIR}/lib/strtok.c
${LIBRARY_DIR}/lib/connect.c
${LIBRARY_DIR}/lib/llist.c
${LIBRARY_DIR}/lib/hash.c
${LIBRARY_DIR}/lib/multi.c
${LIBRARY_DIR}/lib/content_encoding.c
${LIBRARY_DIR}/lib/share.c
${LIBRARY_DIR}/lib/http_digest.c
${LIBRARY_DIR}/lib/md4.c
${LIBRARY_DIR}/lib/md5.c
${LIBRARY_DIR}/lib/http_negotiate.c
${LIBRARY_DIR}/lib/inet_pton.c
${LIBRARY_DIR}/lib/strtoofft.c
${LIBRARY_DIR}/lib/strerror.c
${LIBRARY_DIR}/lib/amigaos.c
${LIBRARY_DIR}/lib/hostasyn.c
${LIBRARY_DIR}/lib/hostip4.c
${LIBRARY_DIR}/lib/hostip6.c
${LIBRARY_DIR}/lib/hostsyn.c
${LIBRARY_DIR}/lib/inet_ntop.c
${LIBRARY_DIR}/lib/parsedate.c
${LIBRARY_DIR}/lib/select.c
${LIBRARY_DIR}/lib/splay.c
${LIBRARY_DIR}/lib/strdup.c
${LIBRARY_DIR}/lib/socks.c
${LIBRARY_DIR}/lib/curl_addrinfo.c
${LIBRARY_DIR}/lib/socks_gssapi.c
${LIBRARY_DIR}/lib/socks_sspi.c
${LIBRARY_DIR}/lib/curl_sspi.c
${LIBRARY_DIR}/lib/slist.c
${LIBRARY_DIR}/lib/nonblock.c
${LIBRARY_DIR}/lib/curl_memrchr.c
${LIBRARY_DIR}/lib/imap.c
${LIBRARY_DIR}/lib/pop3.c
${LIBRARY_DIR}/lib/smtp.c
${LIBRARY_DIR}/lib/pingpong.c
${LIBRARY_DIR}/lib/rtsp.c
${LIBRARY_DIR}/lib/curl_threads.c
${LIBRARY_DIR}/lib/warnless.c
${LIBRARY_DIR}/lib/hmac.c
${LIBRARY_DIR}/lib/curl_rtmp.c
${LIBRARY_DIR}/lib/openldap.c
${LIBRARY_DIR}/lib/curl_gethostname.c
${LIBRARY_DIR}/lib/gopher.c
${LIBRARY_DIR}/lib/idn_win32.c
${LIBRARY_DIR}/lib/http_proxy.c
${LIBRARY_DIR}/lib/non-ascii.c
${LIBRARY_DIR}/lib/asyn-thread.c
${LIBRARY_DIR}/lib/curl_gssapi.c
${LIBRARY_DIR}/lib/http_ntlm.c
${LIBRARY_DIR}/lib/curl_ntlm_wb.c
${LIBRARY_DIR}/lib/curl_ntlm_core.c
${LIBRARY_DIR}/lib/curl_sasl.c
${LIBRARY_DIR}/lib/rand.c
${LIBRARY_DIR}/lib/curl_multibyte.c
${LIBRARY_DIR}/lib/hostcheck.c
${LIBRARY_DIR}/lib/conncache.c
${LIBRARY_DIR}/lib/dotdot.c
${LIBRARY_DIR}/lib/x509asn1.c
${LIBRARY_DIR}/lib/http2.c
${LIBRARY_DIR}/lib/smb.c
${LIBRARY_DIR}/lib/curl_endian.c
${LIBRARY_DIR}/lib/curl_des.c
${LIBRARY_DIR}/lib/system_win32.c
${LIBRARY_DIR}/lib/mime.c
${LIBRARY_DIR}/lib/sha256.c
${LIBRARY_DIR}/lib/setopt.c
${LIBRARY_DIR}/lib/curl_path.c
${LIBRARY_DIR}/lib/curl_ctype.c
${LIBRARY_DIR}/lib/curl_range.c
${LIBRARY_DIR}/lib/psl.c
${LIBRARY_DIR}/lib/doh.c
${LIBRARY_DIR}/lib/urlapi.c
${LIBRARY_DIR}/lib/curl_get_line.c
${LIBRARY_DIR}/lib/altsvc.c
${LIBRARY_DIR}/lib/socketpair.c
${LIBRARY_DIR}/lib/vauth/vauth.c
${LIBRARY_DIR}/lib/vauth/cleartext.c
${LIBRARY_DIR}/lib/vauth/cram.c
${LIBRARY_DIR}/lib/vauth/digest.c
${LIBRARY_DIR}/lib/vauth/digest_sspi.c
${LIBRARY_DIR}/lib/vauth/krb5_gssapi.c
${LIBRARY_DIR}/lib/vauth/krb5_sspi.c
${LIBRARY_DIR}/lib/vauth/ntlm.c
${LIBRARY_DIR}/lib/vauth/ntlm_sspi.c
${LIBRARY_DIR}/lib/vauth/oauth2.c
${LIBRARY_DIR}/lib/vauth/spnego_gssapi.c
${LIBRARY_DIR}/lib/vauth/spnego_sspi.c
${LIBRARY_DIR}/lib/vtls/openssl.c
${LIBRARY_DIR}/lib/vtls/gtls.c
${LIBRARY_DIR}/lib/vtls/vtls.c
${LIBRARY_DIR}/lib/vtls/nss.c
${LIBRARY_DIR}/lib/vtls/polarssl.c
${LIBRARY_DIR}/lib/vtls/polarssl_threadlock.c
${LIBRARY_DIR}/lib/vtls/wolfssl.c
${LIBRARY_DIR}/lib/vtls/schannel.c
${LIBRARY_DIR}/lib/vtls/schannel_verify.c
${LIBRARY_DIR}/lib/vtls/sectransp.c
${LIBRARY_DIR}/lib/vtls/gskit.c
${LIBRARY_DIR}/lib/vtls/mbedtls.c
${LIBRARY_DIR}/lib/vtls/mesalink.c
${LIBRARY_DIR}/lib/vtls/bearssl.c
${LIBRARY_DIR}/lib/vquic/ngtcp2.c
${LIBRARY_DIR}/lib/vquic/quiche.c
${LIBRARY_DIR}/lib/vssh/libssh2.c
${LIBRARY_DIR}/lib/vssh/libssh.c
)
# The library is large - avoid bloat (XXX: is it?) add_library (curl ${SRCS})
target_compile_options (curl PRIVATE -g0)
# find_package(CURL) compatibility for the following packages that uses target_compile_definitions (curl PRIVATE
# find_package(CURL)/include(FindCURL): HAVE_CONFIG_H
# - mariadb-connector-c BUILDING_LIBCURL
# - aws-s3-cmake CURL_HIDDEN_SYMBOLS
# - sentry-native libcurl_EXPORTS
set (CURL_FOUND ON CACHE BOOL "") OS="${CMAKE_SYSTEM_NAME}"
set (CURL_ROOT_DIR ${LIBRARY_DIR} CACHE PATH "") )
set (CURL_INCLUDE_DIR ${LIBRARY_DIR}/include CACHE PATH "") target_include_directories (curl PUBLIC
set (CURL_INCLUDE_DIRS ${LIBRARY_DIR}/include CACHE PATH "") ${LIBRARY_DIR}/include
set (CURL_LIBRARY curl CACHE STRING "") ${LIBRARY_DIR}/lib
set (CURL_LIBRARIES ${CURL_LIBRARY} CACHE STRING "") . # curl_config.h
set (CURL_VERSION_STRING 7.67.0 CACHE STRING "") )
add_library (CURL::libcurl ALIAS ${CURL_LIBRARY})
else () target_link_libraries (curl PRIVATE ssl)
find_package (CURL REQUIRED)
endif () # The library is large - avoid bloat (XXX: is it?)
target_compile_options (curl PRIVATE -g0)
# find_package(CURL) compatibility for the following packages that uses
# find_package(CURL)/include(FindCURL):
# - mariadb-connector-c
# - aws-s3-cmake
# - sentry-native
set (CURL_FOUND ON CACHE BOOL "")
set (CURL_ROOT_DIR ${LIBRARY_DIR} CACHE PATH "")
set (CURL_INCLUDE_DIR ${LIBRARY_DIR}/include CACHE PATH "")
set (CURL_INCLUDE_DIRS ${LIBRARY_DIR}/include CACHE PATH "")
set (CURL_LIBRARY curl CACHE STRING "")
set (CURL_LIBRARIES ${CURL_LIBRARY} CACHE STRING "")
set (CURL_VERSION_STRING 7.67.0 CACHE STRING "")
add_library (CURL::libcurl ALIAS ${CURL_LIBRARY})
set (USE_INTERNAL_CURL 1)
endif () endif ()
message (STATUS "Using curl: ${CURL_INCLUDE_DIRS} : ${CURL_LIBRARIES}") message (STATUS "Using curl: ${CURL_INCLUDE_DIRS} : ${CURL_LIBRARIES}")

View File

@ -1,252 +1,272 @@
option (ENABLE_HYPERSCAN "Enable hyperscan library" ${ENABLE_LIBRARIES}) if (HAVE_SSSE3)
option (ENABLE_HYPERSCAN "Enable hyperscan library" ${ENABLE_LIBRARIES})
if (NOT HAVE_SSSE3) elseif(ENABLE_HYPERSCAN)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't use hyperscan without SSSE3")
set (ENABLE_HYPERSCAN OFF) set (ENABLE_HYPERSCAN OFF)
endif () endif ()
if (ENABLE_HYPERSCAN) if (NOT ENABLE_HYPERSCAN)
option (USE_INTERNAL_HYPERSCAN_LIBRARY "Use internal hyperscan library" ${NOT_UNBUNDLED})
if (USE_INTERNAL_HYPERSCAN_LIBRARY) if (USE_INTERNAL_HYPERSCAN_LIBRARY)
set (LIBRARY_DIR ${ClickHouse_SOURCE_DIR}/contrib/hyperscan) message (${RECONFIGURE_MESSAGE_LEVEL} "Can't use internal hyperscan with ENABLE_HYPERSCAN=OFF")
endif()
set (SRCS add_library (hyperscan INTERFACE)
${LIBRARY_DIR}/src/alloc.c target_compile_definitions (hyperscan INTERFACE USE_HYPERSCAN=0)
${LIBRARY_DIR}/src/compiler/asserts.cpp
${LIBRARY_DIR}/src/compiler/compiler.cpp
${LIBRARY_DIR}/src/compiler/error.cpp
${LIBRARY_DIR}/src/crc32.c
${LIBRARY_DIR}/src/database.c
${LIBRARY_DIR}/src/fdr/engine_description.cpp
${LIBRARY_DIR}/src/fdr/fdr_compile_util.cpp
${LIBRARY_DIR}/src/fdr/fdr_compile.cpp
${LIBRARY_DIR}/src/fdr/fdr_confirm_compile.cpp
${LIBRARY_DIR}/src/fdr/fdr_engine_description.cpp
${LIBRARY_DIR}/src/fdr/fdr.c
${LIBRARY_DIR}/src/fdr/flood_compile.cpp
${LIBRARY_DIR}/src/fdr/teddy_compile.cpp
${LIBRARY_DIR}/src/fdr/teddy_engine_description.cpp
${LIBRARY_DIR}/src/fdr/teddy.c
${LIBRARY_DIR}/src/grey.cpp
${LIBRARY_DIR}/src/hs_valid_platform.c
${LIBRARY_DIR}/src/hs_version.c
${LIBRARY_DIR}/src/hs.cpp
${LIBRARY_DIR}/src/hwlm/hwlm_build.cpp
${LIBRARY_DIR}/src/hwlm/hwlm_literal.cpp
${LIBRARY_DIR}/src/hwlm/hwlm.c
${LIBRARY_DIR}/src/hwlm/noodle_build.cpp
${LIBRARY_DIR}/src/hwlm/noodle_engine.c
${LIBRARY_DIR}/src/nfa/accel_dfa_build_strat.cpp
${LIBRARY_DIR}/src/nfa/accel.c
${LIBRARY_DIR}/src/nfa/accelcompile.cpp
${LIBRARY_DIR}/src/nfa/castle.c
${LIBRARY_DIR}/src/nfa/castlecompile.cpp
${LIBRARY_DIR}/src/nfa/dfa_build_strat.cpp
${LIBRARY_DIR}/src/nfa/dfa_min.cpp
${LIBRARY_DIR}/src/nfa/gough.c
${LIBRARY_DIR}/src/nfa/goughcompile_accel.cpp
${LIBRARY_DIR}/src/nfa/goughcompile_reg.cpp
${LIBRARY_DIR}/src/nfa/goughcompile.cpp
${LIBRARY_DIR}/src/nfa/lbr.c
${LIBRARY_DIR}/src/nfa/limex_64.c
${LIBRARY_DIR}/src/nfa/limex_accel.c
${LIBRARY_DIR}/src/nfa/limex_compile.cpp
${LIBRARY_DIR}/src/nfa/limex_native.c
${LIBRARY_DIR}/src/nfa/limex_simd128.c
${LIBRARY_DIR}/src/nfa/limex_simd256.c
${LIBRARY_DIR}/src/nfa/limex_simd384.c
${LIBRARY_DIR}/src/nfa/limex_simd512.c
${LIBRARY_DIR}/src/nfa/mcclellan.c
${LIBRARY_DIR}/src/nfa/mcclellancompile_util.cpp
${LIBRARY_DIR}/src/nfa/mcclellancompile.cpp
${LIBRARY_DIR}/src/nfa/mcsheng_compile.cpp
${LIBRARY_DIR}/src/nfa/mcsheng_data.c
${LIBRARY_DIR}/src/nfa/mcsheng.c
${LIBRARY_DIR}/src/nfa/mpv.c
${LIBRARY_DIR}/src/nfa/mpvcompile.cpp
${LIBRARY_DIR}/src/nfa/nfa_api_dispatch.c
${LIBRARY_DIR}/src/nfa/nfa_build_util.cpp
${LIBRARY_DIR}/src/nfa/rdfa_graph.cpp
${LIBRARY_DIR}/src/nfa/rdfa_merge.cpp
${LIBRARY_DIR}/src/nfa/rdfa.cpp
${LIBRARY_DIR}/src/nfa/repeat.c
${LIBRARY_DIR}/src/nfa/repeatcompile.cpp
${LIBRARY_DIR}/src/nfa/sheng.c
${LIBRARY_DIR}/src/nfa/shengcompile.cpp
${LIBRARY_DIR}/src/nfa/shufti.c
${LIBRARY_DIR}/src/nfa/shufticompile.cpp
${LIBRARY_DIR}/src/nfa/tamarama.c
${LIBRARY_DIR}/src/nfa/tamaramacompile.cpp
${LIBRARY_DIR}/src/nfa/truffle.c
${LIBRARY_DIR}/src/nfa/trufflecompile.cpp
${LIBRARY_DIR}/src/nfagraph/ng_anchored_acyclic.cpp
${LIBRARY_DIR}/src/nfagraph/ng_anchored_dots.cpp
${LIBRARY_DIR}/src/nfagraph/ng_asserts.cpp
${LIBRARY_DIR}/src/nfagraph/ng_builder.cpp
${LIBRARY_DIR}/src/nfagraph/ng_calc_components.cpp
${LIBRARY_DIR}/src/nfagraph/ng_cyclic_redundancy.cpp
${LIBRARY_DIR}/src/nfagraph/ng_depth.cpp
${LIBRARY_DIR}/src/nfagraph/ng_dominators.cpp
${LIBRARY_DIR}/src/nfagraph/ng_edge_redundancy.cpp
${LIBRARY_DIR}/src/nfagraph/ng_equivalence.cpp
${LIBRARY_DIR}/src/nfagraph/ng_execute.cpp
${LIBRARY_DIR}/src/nfagraph/ng_expr_info.cpp
${LIBRARY_DIR}/src/nfagraph/ng_extparam.cpp
${LIBRARY_DIR}/src/nfagraph/ng_fixed_width.cpp
${LIBRARY_DIR}/src/nfagraph/ng_fuzzy.cpp
${LIBRARY_DIR}/src/nfagraph/ng_haig.cpp
${LIBRARY_DIR}/src/nfagraph/ng_holder.cpp
${LIBRARY_DIR}/src/nfagraph/ng_is_equal.cpp
${LIBRARY_DIR}/src/nfagraph/ng_lbr.cpp
${LIBRARY_DIR}/src/nfagraph/ng_limex_accel.cpp
${LIBRARY_DIR}/src/nfagraph/ng_limex.cpp
${LIBRARY_DIR}/src/nfagraph/ng_literal_analysis.cpp
${LIBRARY_DIR}/src/nfagraph/ng_literal_component.cpp
${LIBRARY_DIR}/src/nfagraph/ng_literal_decorated.cpp
${LIBRARY_DIR}/src/nfagraph/ng_mcclellan.cpp
${LIBRARY_DIR}/src/nfagraph/ng_misc_opt.cpp
${LIBRARY_DIR}/src/nfagraph/ng_netflow.cpp
${LIBRARY_DIR}/src/nfagraph/ng_prefilter.cpp
${LIBRARY_DIR}/src/nfagraph/ng_prune.cpp
${LIBRARY_DIR}/src/nfagraph/ng_puff.cpp
${LIBRARY_DIR}/src/nfagraph/ng_redundancy.cpp
${LIBRARY_DIR}/src/nfagraph/ng_region_redundancy.cpp
${LIBRARY_DIR}/src/nfagraph/ng_region.cpp
${LIBRARY_DIR}/src/nfagraph/ng_repeat.cpp
${LIBRARY_DIR}/src/nfagraph/ng_reports.cpp
${LIBRARY_DIR}/src/nfagraph/ng_restructuring.cpp
${LIBRARY_DIR}/src/nfagraph/ng_revacc.cpp
${LIBRARY_DIR}/src/nfagraph/ng_sep.cpp
${LIBRARY_DIR}/src/nfagraph/ng_small_literal_set.cpp
${LIBRARY_DIR}/src/nfagraph/ng_som_add_redundancy.cpp
${LIBRARY_DIR}/src/nfagraph/ng_som_util.cpp
${LIBRARY_DIR}/src/nfagraph/ng_som.cpp
${LIBRARY_DIR}/src/nfagraph/ng_split.cpp
${LIBRARY_DIR}/src/nfagraph/ng_squash.cpp
${LIBRARY_DIR}/src/nfagraph/ng_stop.cpp
${LIBRARY_DIR}/src/nfagraph/ng_uncalc_components.cpp
${LIBRARY_DIR}/src/nfagraph/ng_utf8.cpp
${LIBRARY_DIR}/src/nfagraph/ng_util.cpp
${LIBRARY_DIR}/src/nfagraph/ng_vacuous.cpp
${LIBRARY_DIR}/src/nfagraph/ng_violet.cpp
${LIBRARY_DIR}/src/nfagraph/ng_width.cpp
${LIBRARY_DIR}/src/nfagraph/ng.cpp
${LIBRARY_DIR}/src/parser/AsciiComponentClass.cpp
${LIBRARY_DIR}/src/parser/buildstate.cpp
${LIBRARY_DIR}/src/parser/check_refs.cpp
${LIBRARY_DIR}/src/parser/Component.cpp
${LIBRARY_DIR}/src/parser/ComponentAlternation.cpp
${LIBRARY_DIR}/src/parser/ComponentAssertion.cpp
${LIBRARY_DIR}/src/parser/ComponentAtomicGroup.cpp
${LIBRARY_DIR}/src/parser/ComponentBackReference.cpp
${LIBRARY_DIR}/src/parser/ComponentBoundary.cpp
${LIBRARY_DIR}/src/parser/ComponentByte.cpp
${LIBRARY_DIR}/src/parser/ComponentClass.cpp
${LIBRARY_DIR}/src/parser/ComponentCondReference.cpp
${LIBRARY_DIR}/src/parser/ComponentEmpty.cpp
${LIBRARY_DIR}/src/parser/ComponentEUS.cpp
${LIBRARY_DIR}/src/parser/ComponentRepeat.cpp
${LIBRARY_DIR}/src/parser/ComponentSequence.cpp
${LIBRARY_DIR}/src/parser/ComponentVisitor.cpp
${LIBRARY_DIR}/src/parser/ComponentWordBoundary.cpp
${LIBRARY_DIR}/src/parser/ConstComponentVisitor.cpp
${LIBRARY_DIR}/src/parser/control_verbs.cpp
${LIBRARY_DIR}/src/parser/logical_combination.cpp
${LIBRARY_DIR}/src/parser/parse_error.cpp
${LIBRARY_DIR}/src/parser/parser_util.cpp
${LIBRARY_DIR}/src/parser/Parser.cpp
${LIBRARY_DIR}/src/parser/prefilter.cpp
${LIBRARY_DIR}/src/parser/shortcut_literal.cpp
${LIBRARY_DIR}/src/parser/ucp_table.cpp
${LIBRARY_DIR}/src/parser/unsupported.cpp
${LIBRARY_DIR}/src/parser/utf8_validate.cpp
${LIBRARY_DIR}/src/parser/Utf8ComponentClass.cpp
${LIBRARY_DIR}/src/rose/block.c
${LIBRARY_DIR}/src/rose/catchup.c
${LIBRARY_DIR}/src/rose/init.c
${LIBRARY_DIR}/src/rose/match.c
${LIBRARY_DIR}/src/rose/program_runtime.c
${LIBRARY_DIR}/src/rose/rose_build_add_mask.cpp
${LIBRARY_DIR}/src/rose/rose_build_add.cpp
${LIBRARY_DIR}/src/rose/rose_build_anchored.cpp
${LIBRARY_DIR}/src/rose/rose_build_bytecode.cpp
${LIBRARY_DIR}/src/rose/rose_build_castle.cpp
${LIBRARY_DIR}/src/rose/rose_build_compile.cpp
${LIBRARY_DIR}/src/rose/rose_build_convert.cpp
${LIBRARY_DIR}/src/rose/rose_build_dedupe.cpp
${LIBRARY_DIR}/src/rose/rose_build_engine_blob.cpp
${LIBRARY_DIR}/src/rose/rose_build_exclusive.cpp
${LIBRARY_DIR}/src/rose/rose_build_groups.cpp
${LIBRARY_DIR}/src/rose/rose_build_infix.cpp
${LIBRARY_DIR}/src/rose/rose_build_instructions.cpp
${LIBRARY_DIR}/src/rose/rose_build_lit_accel.cpp
${LIBRARY_DIR}/src/rose/rose_build_long_lit.cpp
${LIBRARY_DIR}/src/rose/rose_build_lookaround.cpp
${LIBRARY_DIR}/src/rose/rose_build_matchers.cpp
${LIBRARY_DIR}/src/rose/rose_build_merge.cpp
${LIBRARY_DIR}/src/rose/rose_build_misc.cpp
${LIBRARY_DIR}/src/rose/rose_build_program.cpp
${LIBRARY_DIR}/src/rose/rose_build_role_aliasing.cpp
${LIBRARY_DIR}/src/rose/rose_build_scatter.cpp
${LIBRARY_DIR}/src/rose/rose_build_width.cpp
${LIBRARY_DIR}/src/rose/rose_in_util.cpp
${LIBRARY_DIR}/src/rose/stream.c
${LIBRARY_DIR}/src/runtime.c
${LIBRARY_DIR}/src/scratch.c
${LIBRARY_DIR}/src/smallwrite/smallwrite_build.cpp
${LIBRARY_DIR}/src/som/slot_manager.cpp
${LIBRARY_DIR}/src/som/som_runtime.c
${LIBRARY_DIR}/src/som/som_stream.c
${LIBRARY_DIR}/src/stream_compress.c
${LIBRARY_DIR}/src/util/alloc.cpp
${LIBRARY_DIR}/src/util/charreach.cpp
${LIBRARY_DIR}/src/util/clique.cpp
${LIBRARY_DIR}/src/util/compile_context.cpp
${LIBRARY_DIR}/src/util/compile_error.cpp
${LIBRARY_DIR}/src/util/cpuid_flags.c
${LIBRARY_DIR}/src/util/depth.cpp
${LIBRARY_DIR}/src/util/fatbit_build.cpp
${LIBRARY_DIR}/src/util/multibit_build.cpp
${LIBRARY_DIR}/src/util/multibit.c
${LIBRARY_DIR}/src/util/report_manager.cpp
${LIBRARY_DIR}/src/util/simd_utils.c
${LIBRARY_DIR}/src/util/state_compress.c
${LIBRARY_DIR}/src/util/target_info.cpp
${LIBRARY_DIR}/src/util/ue2string.cpp
)
add_library (hyperscan ${SRCS}) message (STATUS "Not using hyperscan")
return()
endif()
target_compile_definitions (hyperscan PUBLIC USE_HYPERSCAN=1) option (USE_INTERNAL_HYPERSCAN_LIBRARY "Use internal hyperscan library" ${NOT_UNBUNDLED})
target_compile_options (hyperscan
PRIVATE -g0 # Library has too much debug information if (NOT USE_INTERNAL_HYPERSCAN_LIBRARY)
-march=corei7 -O2 -fno-strict-aliasing -fno-omit-frame-pointer -fvisibility=hidden # The options from original build system find_library (LIBRARY_HYPERSCAN hs)
-fno-sanitize=undefined # Assume the library takes care of itself find_path (INCLUDE_HYPERSCAN NAMES hs.h HINTS /usr/include/hs) # Ubuntu puts headers in this folder
)
target_include_directories (hyperscan if (LIBRARY_HYPERSCAN AND INCLUDE_HYPERSCAN)
PRIVATE set (EXTERNAL_HYPERSCAN_LIBRARY_FOUND 1)
common
${LIBRARY_DIR}/include
)
target_include_directories (hyperscan SYSTEM PUBLIC ${LIBRARY_DIR}/src)
if (ARCH_AMD64)
target_include_directories (hyperscan PRIVATE x86_64)
endif ()
target_link_libraries (hyperscan PRIVATE boost::headers_only)
else ()
find_library (LIBRARY_HYPERSCAN hs)
find_path (INCLUDE_HYPERSCAN NAMES hs.h HINTS /usr/include/hs) # Ubuntu puts headers in this folder
add_library (hyperscan UNKNOWN IMPORTED GLOBAL) add_library (hyperscan UNKNOWN IMPORTED GLOBAL)
set_target_properties (hyperscan PROPERTIES IMPORTED_LOCATION ${LIBRARY_HYPERSCAN}) set_target_properties (hyperscan PROPERTIES IMPORTED_LOCATION ${LIBRARY_HYPERSCAN})
set_target_properties (hyperscan PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${INCLUDE_HYPERSCAN}) set_target_properties (hyperscan PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${INCLUDE_HYPERSCAN})
set_property(TARGET hyperscan APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS USE_HYPERSCAN=1) set_property(TARGET hyperscan APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS USE_HYPERSCAN=1)
else ()
set (EXTERNAL_HYPERSCAN_LIBRARY_FOUND 0)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find system hyperscan library")
endif () endif ()
message (STATUS "Using hyperscan")
else ()
add_library (hyperscan INTERFACE)
target_compile_definitions (hyperscan INTERFACE USE_HYPERSCAN=0)
message (STATUS "Not using hyperscan")
endif () endif ()
if (NOT EXTERNAL_HYPERSCAN_LIBRARY_FOUND)
set (USE_INTERNAL_HYPERSCAN_LIBRARY 1)
set (LIBRARY_DIR ${ClickHouse_SOURCE_DIR}/contrib/hyperscan)
set (SRCS
${LIBRARY_DIR}/src/alloc.c
${LIBRARY_DIR}/src/compiler/asserts.cpp
${LIBRARY_DIR}/src/compiler/compiler.cpp
${LIBRARY_DIR}/src/compiler/error.cpp
${LIBRARY_DIR}/src/crc32.c
${LIBRARY_DIR}/src/database.c
${LIBRARY_DIR}/src/fdr/engine_description.cpp
${LIBRARY_DIR}/src/fdr/fdr_compile_util.cpp
${LIBRARY_DIR}/src/fdr/fdr_compile.cpp
${LIBRARY_DIR}/src/fdr/fdr_confirm_compile.cpp
${LIBRARY_DIR}/src/fdr/fdr_engine_description.cpp
${LIBRARY_DIR}/src/fdr/fdr.c
${LIBRARY_DIR}/src/fdr/flood_compile.cpp
${LIBRARY_DIR}/src/fdr/teddy_compile.cpp
${LIBRARY_DIR}/src/fdr/teddy_engine_description.cpp
${LIBRARY_DIR}/src/fdr/teddy.c
${LIBRARY_DIR}/src/grey.cpp
${LIBRARY_DIR}/src/hs_valid_platform.c
${LIBRARY_DIR}/src/hs_version.c
${LIBRARY_DIR}/src/hs.cpp
${LIBRARY_DIR}/src/hwlm/hwlm_build.cpp
${LIBRARY_DIR}/src/hwlm/hwlm_literal.cpp
${LIBRARY_DIR}/src/hwlm/hwlm.c
${LIBRARY_DIR}/src/hwlm/noodle_build.cpp
${LIBRARY_DIR}/src/hwlm/noodle_engine.c
${LIBRARY_DIR}/src/nfa/accel_dfa_build_strat.cpp
${LIBRARY_DIR}/src/nfa/accel.c
${LIBRARY_DIR}/src/nfa/accelcompile.cpp
${LIBRARY_DIR}/src/nfa/castle.c
${LIBRARY_DIR}/src/nfa/castlecompile.cpp
${LIBRARY_DIR}/src/nfa/dfa_build_strat.cpp
${LIBRARY_DIR}/src/nfa/dfa_min.cpp
${LIBRARY_DIR}/src/nfa/gough.c
${LIBRARY_DIR}/src/nfa/goughcompile_accel.cpp
${LIBRARY_DIR}/src/nfa/goughcompile_reg.cpp
${LIBRARY_DIR}/src/nfa/goughcompile.cpp
${LIBRARY_DIR}/src/nfa/lbr.c
${LIBRARY_DIR}/src/nfa/limex_64.c
${LIBRARY_DIR}/src/nfa/limex_accel.c
${LIBRARY_DIR}/src/nfa/limex_compile.cpp
${LIBRARY_DIR}/src/nfa/limex_native.c
${LIBRARY_DIR}/src/nfa/limex_simd128.c
${LIBRARY_DIR}/src/nfa/limex_simd256.c
${LIBRARY_DIR}/src/nfa/limex_simd384.c
${LIBRARY_DIR}/src/nfa/limex_simd512.c
${LIBRARY_DIR}/src/nfa/mcclellan.c
${LIBRARY_DIR}/src/nfa/mcclellancompile_util.cpp
${LIBRARY_DIR}/src/nfa/mcclellancompile.cpp
${LIBRARY_DIR}/src/nfa/mcsheng_compile.cpp
${LIBRARY_DIR}/src/nfa/mcsheng_data.c
${LIBRARY_DIR}/src/nfa/mcsheng.c
${LIBRARY_DIR}/src/nfa/mpv.c
${LIBRARY_DIR}/src/nfa/mpvcompile.cpp
${LIBRARY_DIR}/src/nfa/nfa_api_dispatch.c
${LIBRARY_DIR}/src/nfa/nfa_build_util.cpp
${LIBRARY_DIR}/src/nfa/rdfa_graph.cpp
${LIBRARY_DIR}/src/nfa/rdfa_merge.cpp
${LIBRARY_DIR}/src/nfa/rdfa.cpp
${LIBRARY_DIR}/src/nfa/repeat.c
${LIBRARY_DIR}/src/nfa/repeatcompile.cpp
${LIBRARY_DIR}/src/nfa/sheng.c
${LIBRARY_DIR}/src/nfa/shengcompile.cpp
${LIBRARY_DIR}/src/nfa/shufti.c
${LIBRARY_DIR}/src/nfa/shufticompile.cpp
${LIBRARY_DIR}/src/nfa/tamarama.c
${LIBRARY_DIR}/src/nfa/tamaramacompile.cpp
${LIBRARY_DIR}/src/nfa/truffle.c
${LIBRARY_DIR}/src/nfa/trufflecompile.cpp
${LIBRARY_DIR}/src/nfagraph/ng_anchored_acyclic.cpp
${LIBRARY_DIR}/src/nfagraph/ng_anchored_dots.cpp
${LIBRARY_DIR}/src/nfagraph/ng_asserts.cpp
${LIBRARY_DIR}/src/nfagraph/ng_builder.cpp
${LIBRARY_DIR}/src/nfagraph/ng_calc_components.cpp
${LIBRARY_DIR}/src/nfagraph/ng_cyclic_redundancy.cpp
${LIBRARY_DIR}/src/nfagraph/ng_depth.cpp
${LIBRARY_DIR}/src/nfagraph/ng_dominators.cpp
${LIBRARY_DIR}/src/nfagraph/ng_edge_redundancy.cpp
${LIBRARY_DIR}/src/nfagraph/ng_equivalence.cpp
${LIBRARY_DIR}/src/nfagraph/ng_execute.cpp
${LIBRARY_DIR}/src/nfagraph/ng_expr_info.cpp
${LIBRARY_DIR}/src/nfagraph/ng_extparam.cpp
${LIBRARY_DIR}/src/nfagraph/ng_fixed_width.cpp
${LIBRARY_DIR}/src/nfagraph/ng_fuzzy.cpp
${LIBRARY_DIR}/src/nfagraph/ng_haig.cpp
${LIBRARY_DIR}/src/nfagraph/ng_holder.cpp
${LIBRARY_DIR}/src/nfagraph/ng_is_equal.cpp
${LIBRARY_DIR}/src/nfagraph/ng_lbr.cpp
${LIBRARY_DIR}/src/nfagraph/ng_limex_accel.cpp
${LIBRARY_DIR}/src/nfagraph/ng_limex.cpp
${LIBRARY_DIR}/src/nfagraph/ng_literal_analysis.cpp
${LIBRARY_DIR}/src/nfagraph/ng_literal_component.cpp
${LIBRARY_DIR}/src/nfagraph/ng_literal_decorated.cpp
${LIBRARY_DIR}/src/nfagraph/ng_mcclellan.cpp
${LIBRARY_DIR}/src/nfagraph/ng_misc_opt.cpp
${LIBRARY_DIR}/src/nfagraph/ng_netflow.cpp
${LIBRARY_DIR}/src/nfagraph/ng_prefilter.cpp
${LIBRARY_DIR}/src/nfagraph/ng_prune.cpp
${LIBRARY_DIR}/src/nfagraph/ng_puff.cpp
${LIBRARY_DIR}/src/nfagraph/ng_redundancy.cpp
${LIBRARY_DIR}/src/nfagraph/ng_region_redundancy.cpp
${LIBRARY_DIR}/src/nfagraph/ng_region.cpp
${LIBRARY_DIR}/src/nfagraph/ng_repeat.cpp
${LIBRARY_DIR}/src/nfagraph/ng_reports.cpp
${LIBRARY_DIR}/src/nfagraph/ng_restructuring.cpp
${LIBRARY_DIR}/src/nfagraph/ng_revacc.cpp
${LIBRARY_DIR}/src/nfagraph/ng_sep.cpp
${LIBRARY_DIR}/src/nfagraph/ng_small_literal_set.cpp
${LIBRARY_DIR}/src/nfagraph/ng_som_add_redundancy.cpp
${LIBRARY_DIR}/src/nfagraph/ng_som_util.cpp
${LIBRARY_DIR}/src/nfagraph/ng_som.cpp
${LIBRARY_DIR}/src/nfagraph/ng_split.cpp
${LIBRARY_DIR}/src/nfagraph/ng_squash.cpp
${LIBRARY_DIR}/src/nfagraph/ng_stop.cpp
${LIBRARY_DIR}/src/nfagraph/ng_uncalc_components.cpp
${LIBRARY_DIR}/src/nfagraph/ng_utf8.cpp
${LIBRARY_DIR}/src/nfagraph/ng_util.cpp
${LIBRARY_DIR}/src/nfagraph/ng_vacuous.cpp
${LIBRARY_DIR}/src/nfagraph/ng_violet.cpp
${LIBRARY_DIR}/src/nfagraph/ng_width.cpp
${LIBRARY_DIR}/src/nfagraph/ng.cpp
${LIBRARY_DIR}/src/parser/AsciiComponentClass.cpp
${LIBRARY_DIR}/src/parser/buildstate.cpp
${LIBRARY_DIR}/src/parser/check_refs.cpp
${LIBRARY_DIR}/src/parser/Component.cpp
${LIBRARY_DIR}/src/parser/ComponentAlternation.cpp
${LIBRARY_DIR}/src/parser/ComponentAssertion.cpp
${LIBRARY_DIR}/src/parser/ComponentAtomicGroup.cpp
${LIBRARY_DIR}/src/parser/ComponentBackReference.cpp
${LIBRARY_DIR}/src/parser/ComponentBoundary.cpp
${LIBRARY_DIR}/src/parser/ComponentByte.cpp
${LIBRARY_DIR}/src/parser/ComponentClass.cpp
${LIBRARY_DIR}/src/parser/ComponentCondReference.cpp
${LIBRARY_DIR}/src/parser/ComponentEmpty.cpp
${LIBRARY_DIR}/src/parser/ComponentEUS.cpp
${LIBRARY_DIR}/src/parser/ComponentRepeat.cpp
${LIBRARY_DIR}/src/parser/ComponentSequence.cpp
${LIBRARY_DIR}/src/parser/ComponentVisitor.cpp
${LIBRARY_DIR}/src/parser/ComponentWordBoundary.cpp
${LIBRARY_DIR}/src/parser/ConstComponentVisitor.cpp
${LIBRARY_DIR}/src/parser/control_verbs.cpp
${LIBRARY_DIR}/src/parser/logical_combination.cpp
${LIBRARY_DIR}/src/parser/parse_error.cpp
${LIBRARY_DIR}/src/parser/parser_util.cpp
${LIBRARY_DIR}/src/parser/Parser.cpp
${LIBRARY_DIR}/src/parser/prefilter.cpp
${LIBRARY_DIR}/src/parser/shortcut_literal.cpp
${LIBRARY_DIR}/src/parser/ucp_table.cpp
${LIBRARY_DIR}/src/parser/unsupported.cpp
${LIBRARY_DIR}/src/parser/utf8_validate.cpp
${LIBRARY_DIR}/src/parser/Utf8ComponentClass.cpp
${LIBRARY_DIR}/src/rose/block.c
${LIBRARY_DIR}/src/rose/catchup.c
${LIBRARY_DIR}/src/rose/init.c
${LIBRARY_DIR}/src/rose/match.c
${LIBRARY_DIR}/src/rose/program_runtime.c
${LIBRARY_DIR}/src/rose/rose_build_add_mask.cpp
${LIBRARY_DIR}/src/rose/rose_build_add.cpp
${LIBRARY_DIR}/src/rose/rose_build_anchored.cpp
${LIBRARY_DIR}/src/rose/rose_build_bytecode.cpp
${LIBRARY_DIR}/src/rose/rose_build_castle.cpp
${LIBRARY_DIR}/src/rose/rose_build_compile.cpp
${LIBRARY_DIR}/src/rose/rose_build_convert.cpp
${LIBRARY_DIR}/src/rose/rose_build_dedupe.cpp
${LIBRARY_DIR}/src/rose/rose_build_engine_blob.cpp
${LIBRARY_DIR}/src/rose/rose_build_exclusive.cpp
${LIBRARY_DIR}/src/rose/rose_build_groups.cpp
${LIBRARY_DIR}/src/rose/rose_build_infix.cpp
${LIBRARY_DIR}/src/rose/rose_build_instructions.cpp
${LIBRARY_DIR}/src/rose/rose_build_lit_accel.cpp
${LIBRARY_DIR}/src/rose/rose_build_long_lit.cpp
${LIBRARY_DIR}/src/rose/rose_build_lookaround.cpp
${LIBRARY_DIR}/src/rose/rose_build_matchers.cpp
${LIBRARY_DIR}/src/rose/rose_build_merge.cpp
${LIBRARY_DIR}/src/rose/rose_build_misc.cpp
${LIBRARY_DIR}/src/rose/rose_build_program.cpp
${LIBRARY_DIR}/src/rose/rose_build_role_aliasing.cpp
${LIBRARY_DIR}/src/rose/rose_build_scatter.cpp
${LIBRARY_DIR}/src/rose/rose_build_width.cpp
${LIBRARY_DIR}/src/rose/rose_in_util.cpp
${LIBRARY_DIR}/src/rose/stream.c
${LIBRARY_DIR}/src/runtime.c
${LIBRARY_DIR}/src/scratch.c
${LIBRARY_DIR}/src/smallwrite/smallwrite_build.cpp
${LIBRARY_DIR}/src/som/slot_manager.cpp
${LIBRARY_DIR}/src/som/som_runtime.c
${LIBRARY_DIR}/src/som/som_stream.c
${LIBRARY_DIR}/src/stream_compress.c
${LIBRARY_DIR}/src/util/alloc.cpp
${LIBRARY_DIR}/src/util/charreach.cpp
${LIBRARY_DIR}/src/util/clique.cpp
${LIBRARY_DIR}/src/util/compile_context.cpp
${LIBRARY_DIR}/src/util/compile_error.cpp
${LIBRARY_DIR}/src/util/cpuid_flags.c
${LIBRARY_DIR}/src/util/depth.cpp
${LIBRARY_DIR}/src/util/fatbit_build.cpp
${LIBRARY_DIR}/src/util/multibit_build.cpp
${LIBRARY_DIR}/src/util/multibit.c
${LIBRARY_DIR}/src/util/report_manager.cpp
${LIBRARY_DIR}/src/util/simd_utils.c
${LIBRARY_DIR}/src/util/state_compress.c
${LIBRARY_DIR}/src/util/target_info.cpp
${LIBRARY_DIR}/src/util/ue2string.cpp
)
add_library (hyperscan ${SRCS})
target_compile_definitions (hyperscan PUBLIC USE_HYPERSCAN=1)
target_compile_options (hyperscan
PRIVATE -g0 # Library has too much debug information
-march=corei7 -O2 -fno-strict-aliasing -fno-omit-frame-pointer -fvisibility=hidden # The options from original build system
-fno-sanitize=undefined # Assume the library takes care of itself
)
target_include_directories (hyperscan
PRIVATE
common
${LIBRARY_DIR}/include
)
target_include_directories (hyperscan SYSTEM PUBLIC ${LIBRARY_DIR}/src)
if (ARCH_AMD64)
target_include_directories (hyperscan PRIVATE x86_64)
endif ()
target_link_libraries (hyperscan PRIVATE boost::headers_only)
set (USE_INTERNAL_HYPERSCAN_LIBRARY 1)
endif ()
message (STATUS "Using hyperscan")

View File

@ -2,140 +2,40 @@ option (ENABLE_JEMALLOC "Enable jemalloc allocator" ${ENABLE_LIBRARIES})
if (SANITIZE OR NOT (ARCH_AMD64 OR ARCH_ARM) OR NOT (OS_LINUX OR OS_FREEBSD OR OS_DARWIN)) if (SANITIZE OR NOT (ARCH_AMD64 OR ARCH_ARM) OR NOT (OS_LINUX OR OS_FREEBSD OR OS_DARWIN))
set (ENABLE_JEMALLOC OFF) set (ENABLE_JEMALLOC OFF)
message (STATUS "jemalloc is disabled implicitly: it doesn't work with sanitizers and can only be used with x86_64 or aarch64 on linux or freebsd.") message (${RECONFIGURE_MESSAGE_LEVEL}
"jemalloc is disabled implicitly: it doesn't work with sanitizers and can only be used with x86_64 or aarch64 on linux or freebsd.")
endif () endif ()
if (ENABLE_JEMALLOC) if (NOT ENABLE_JEMALLOC)
if (NOT OS_LINUX) if(USE_INTERNAL_JEMALLOC_LIBRARY)
message (WARNING "jemalloc support on non-linux is EXPERIMENTAL") message (${RECONFIGURE_MESSAGE_LEVEL} "Can't use internal jemalloc with ENABLE_JEMALLOC=OFF")
endif() endif()
option (USE_INTERNAL_JEMALLOC "Use internal jemalloc library" ${NOT_UNBUNDLED}) add_library(jemalloc INTERFACE)
target_compile_definitions(jemalloc INTERFACE USE_JEMALLOC=0)
if (USE_INTERNAL_JEMALLOC) message (STATUS "Not using jemalloc")
if (OS_LINUX) return()
# ThreadPool select job randomly, and there can be some threads that had been endif ()
# performed some memory heavy task before and will be inactive for some time,
# but until it will became active again, the memory will not be freed since by
# default each thread has it's own arena, but there should be not more then
# 4*CPU arenas (see opt.nareans description).
#
# By enabling percpu_arena number of arenas limited to number of CPUs and hence
# this problem should go away.
#
# muzzy_decay_ms -- use MADV_FREE when available on newer Linuxes, to
# avoid spurious latencies and additional work associated with
# MADV_DONTNEED. See
# https://github.com/ClickHouse/ClickHouse/issues/11121 for motivation.
set (JEMALLOC_CONFIG_MALLOC_CONF "percpu_arena:percpu,oversize_threshold:0,muzzy_decay_ms:10000")
else()
set (JEMALLOC_CONFIG_MALLOC_CONF "oversize_threshold:0,muzzy_decay_ms:10000")
endif()
# CACHE variable is empty, to allow changing defaults without necessity
# to purge cache
set (JEMALLOC_CONFIG_MALLOC_CONF_OVERRIDE "" CACHE STRING "Change default configuration string of JEMalloc" )
if (JEMALLOC_CONFIG_MALLOC_CONF_OVERRIDE)
set (JEMALLOC_CONFIG_MALLOC_CONF "${JEMALLOC_CONFIG_MALLOC_CONF_OVERRIDE}")
endif()
message (STATUS "jemalloc malloc_conf: ${JEMALLOC_CONFIG_MALLOC_CONF}")
set (LIBRARY_DIR "${ClickHouse_SOURCE_DIR}/contrib/jemalloc") if (NOT OS_LINUX)
message (WARNING "jemalloc support on non-linux is EXPERIMENTAL")
endif()
set (SRCS option (USE_INTERNAL_JEMALLOC_LIBRARY "Use internal jemalloc library" ${NOT_UNBUNDLED})
${LIBRARY_DIR}/src/arena.c
${LIBRARY_DIR}/src/background_thread.c
${LIBRARY_DIR}/src/base.c
${LIBRARY_DIR}/src/bin.c
${LIBRARY_DIR}/src/bitmap.c
${LIBRARY_DIR}/src/ckh.c
${LIBRARY_DIR}/src/ctl.c
${LIBRARY_DIR}/src/div.c
${LIBRARY_DIR}/src/extent.c
${LIBRARY_DIR}/src/extent_dss.c
${LIBRARY_DIR}/src/extent_mmap.c
${LIBRARY_DIR}/src/hash.c
${LIBRARY_DIR}/src/hook.c
${LIBRARY_DIR}/src/jemalloc.c
${LIBRARY_DIR}/src/large.c
${LIBRARY_DIR}/src/log.c
${LIBRARY_DIR}/src/malloc_io.c
${LIBRARY_DIR}/src/mutex.c
${LIBRARY_DIR}/src/mutex_pool.c
${LIBRARY_DIR}/src/nstime.c
${LIBRARY_DIR}/src/pages.c
${LIBRARY_DIR}/src/prng.c
${LIBRARY_DIR}/src/prof.c
${LIBRARY_DIR}/src/rtree.c
${LIBRARY_DIR}/src/sc.c
${LIBRARY_DIR}/src/stats.c
${LIBRARY_DIR}/src/sz.c
${LIBRARY_DIR}/src/tcache.c
${LIBRARY_DIR}/src/test_hooks.c
${LIBRARY_DIR}/src/ticker.c
${LIBRARY_DIR}/src/tsd.c
${LIBRARY_DIR}/src/witness.c
${LIBRARY_DIR}/src/safety_check.c
)
if (OS_DARWIN)
list(APPEND SRCS ${LIBRARY_DIR}/src/zone.c)
endif ()
add_library(jemalloc ${SRCS}) if (NOT USE_INTERNAL_JEMALLOC_LIBRARY)
target_include_directories(jemalloc PRIVATE ${LIBRARY_DIR}/include) find_library(LIBRARY_JEMALLOC jemalloc)
target_include_directories(jemalloc SYSTEM PUBLIC include) find_path(INCLUDE_JEMALLOC jemalloc/jemalloc.h)
set (JEMALLOC_INCLUDE_PREFIX) if (LIBRARY_JEMALLOC AND INCLUDE_JEMALLOC)
# OS_ set(EXTERNAL_JEMALLOC_LIBRARY_FOUND 1)
if (OS_LINUX)
set (JEMALLOC_INCLUDE_PREFIX "include_linux")
elseif (OS_FREEBSD)
set (JEMALLOC_INCLUDE_PREFIX "include_freebsd")
elseif (OS_DARWIN)
set (JEMALLOC_INCLUDE_PREFIX "include_darwin")
else ()
message (FATAL_ERROR "This OS is not supported")
endif ()
# ARCH_
if (ARCH_AMD64)
set(JEMALLOC_INCLUDE_PREFIX "${JEMALLOC_INCLUDE_PREFIX}_x86_64")
elseif (ARCH_ARM)
set(JEMALLOC_INCLUDE_PREFIX "${JEMALLOC_INCLUDE_PREFIX}_aarch64")
else ()
message (FATAL_ERROR "This arch is not supported")
endif ()
configure_file(${JEMALLOC_INCLUDE_PREFIX}/jemalloc/internal/jemalloc_internal_defs.h.in
${JEMALLOC_INCLUDE_PREFIX}/jemalloc/internal/jemalloc_internal_defs.h)
target_include_directories(jemalloc SYSTEM PRIVATE
${CMAKE_CURRENT_BINARY_DIR}/${JEMALLOC_INCLUDE_PREFIX}/jemalloc/internal)
target_compile_definitions(jemalloc PRIVATE -DJEMALLOC_NO_PRIVATE_NAMESPACE)
if (CMAKE_BUILD_TYPE_UC STREQUAL "DEBUG")
target_compile_definitions(jemalloc PRIVATE -DJEMALLOC_DEBUG=1 -DJEMALLOC_PROF=1)
if (USE_UNWIND)
target_compile_definitions (jemalloc PRIVATE -DJEMALLOC_PROF_LIBUNWIND=1)
target_link_libraries (jemalloc PRIVATE unwind)
endif ()
endif ()
target_compile_options(jemalloc PRIVATE -Wno-redundant-decls)
# for RTLD_NEXT
target_compile_options(jemalloc PRIVATE -D_GNU_SOURCE)
else ()
find_library(LIBRARY_JEMALLOC jemalloc)
find_path(INCLUDE_JEMALLOC jemalloc/jemalloc.h)
set(THREADS_PREFER_PTHREAD_FLAG ON) set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED) find_package(Threads)
add_library (jemalloc STATIC IMPORTED) set (CMAKE_REQUIRED_LIBRARIES ${LIBRARY_JEMALLOC} Threads::Threads "dl")
set_property (TARGET jemalloc PROPERTY IMPORTED_LOCATION ${LIBRARY_JEMALLOC}) set (CMAKE_REQUIRED_INCLUDES ${INCLUDE_JEMALLOC})
set_property (TARGET jemalloc PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${INCLUDE_JEMALLOC})
set_property (TARGET jemalloc PROPERTY INTERFACE_LINK_LIBRARIES Threads::Threads dl)
set (CMAKE_REQUIRED_LIBRARIES jemalloc)
check_cxx_source_compiles ( check_cxx_source_compiles (
" "
#include <jemalloc/jemalloc.h> #include <jemalloc/jemalloc.h>
@ -144,24 +44,145 @@ if (ENABLE_JEMALLOC)
free(mallocx(1, 0)); free(mallocx(1, 0));
} }
" "
EXTERNAL_JEMALLOC_WORKS EXTERNAL_JEMALLOC_LIBRARY_WORKS
) )
if (NOT EXTERNAL_JEMALLOC_WORKS) if (EXTERNAL_JEMALLOC_LIBRARY_WORKS)
message (FATAL_ERROR "jemalloc is unusable: ${LIBRARY_JEMALLOC} ${INCLUDE_JEMALLOC}") add_library (jemalloc STATIC IMPORTED)
set_property (TARGET jemalloc PROPERTY IMPORTED_LOCATION ${LIBRARY_JEMALLOC})
set_property (TARGET jemalloc PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${INCLUDE_JEMALLOC})
set_property (TARGET jemalloc PROPERTY INTERFACE_LINK_LIBRARIES Threads::Threads dl)
else()
message (${RECONFIGURE_MESSAGE_LEVEL} "External jemalloc is unusable: ${LIBRARY_JEMALLOC} ${INCLUDE_JEMALLOC}")
endif ()
else()
set(EXTERNAL_JEMALLOC_LIBRARY_FOUND 0)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find system jemalloc")
endif()
endif ()
if (NOT EXTERNAL_JEMALLOC_LIBRARY_FOUND OR NOT EXTERNAL_JEMALLOC_LIBRARY_WORKS)
set(USE_INTERNAL_JEMALLOC_LIBRARY 1)
if (OS_LINUX)
# ThreadPool select job randomly, and there can be some threads that had been
# performed some memory heavy task before and will be inactive for some time,
# but until it will became active again, the memory will not be freed since by
# default each thread has it's own arena, but there should be not more then
# 4*CPU arenas (see opt.nareans description).
#
# By enabling percpu_arena number of arenas limited to number of CPUs and hence
# this problem should go away.
#
# muzzy_decay_ms -- use MADV_FREE when available on newer Linuxes, to
# avoid spurious latencies and additional work associated with
# MADV_DONTNEED. See
# https://github.com/ClickHouse/ClickHouse/issues/11121 for motivation.
set (JEMALLOC_CONFIG_MALLOC_CONF "percpu_arena:percpu,oversize_threshold:0,muzzy_decay_ms:10000")
else()
set (JEMALLOC_CONFIG_MALLOC_CONF "oversize_threshold:0,muzzy_decay_ms:10000")
endif()
# CACHE variable is empty, to allow changing defaults without necessity
# to purge cache
set (JEMALLOC_CONFIG_MALLOC_CONF_OVERRIDE "" CACHE STRING "Change default configuration string of JEMalloc" )
if (JEMALLOC_CONFIG_MALLOC_CONF_OVERRIDE)
set (JEMALLOC_CONFIG_MALLOC_CONF "${JEMALLOC_CONFIG_MALLOC_CONF_OVERRIDE}")
endif()
message (STATUS "jemalloc malloc_conf: ${JEMALLOC_CONFIG_MALLOC_CONF}")
set (LIBRARY_DIR "${ClickHouse_SOURCE_DIR}/contrib/jemalloc")
set (SRCS
${LIBRARY_DIR}/src/arena.c
${LIBRARY_DIR}/src/background_thread.c
${LIBRARY_DIR}/src/base.c
${LIBRARY_DIR}/src/bin.c
${LIBRARY_DIR}/src/bitmap.c
${LIBRARY_DIR}/src/ckh.c
${LIBRARY_DIR}/src/ctl.c
${LIBRARY_DIR}/src/div.c
${LIBRARY_DIR}/src/extent.c
${LIBRARY_DIR}/src/extent_dss.c
${LIBRARY_DIR}/src/extent_mmap.c
${LIBRARY_DIR}/src/hash.c
${LIBRARY_DIR}/src/hook.c
${LIBRARY_DIR}/src/jemalloc.c
${LIBRARY_DIR}/src/large.c
${LIBRARY_DIR}/src/log.c
${LIBRARY_DIR}/src/malloc_io.c
${LIBRARY_DIR}/src/mutex.c
${LIBRARY_DIR}/src/mutex_pool.c
${LIBRARY_DIR}/src/nstime.c
${LIBRARY_DIR}/src/pages.c
${LIBRARY_DIR}/src/prng.c
${LIBRARY_DIR}/src/prof.c
${LIBRARY_DIR}/src/rtree.c
${LIBRARY_DIR}/src/sc.c
${LIBRARY_DIR}/src/stats.c
${LIBRARY_DIR}/src/sz.c
${LIBRARY_DIR}/src/tcache.c
${LIBRARY_DIR}/src/test_hooks.c
${LIBRARY_DIR}/src/ticker.c
${LIBRARY_DIR}/src/tsd.c
${LIBRARY_DIR}/src/witness.c
${LIBRARY_DIR}/src/safety_check.c
)
if (OS_DARWIN)
list(APPEND SRCS ${LIBRARY_DIR}/src/zone.c)
endif ()
add_library(jemalloc ${SRCS})
target_include_directories(jemalloc PRIVATE ${LIBRARY_DIR}/include)
target_include_directories(jemalloc SYSTEM PUBLIC include)
set (JEMALLOC_INCLUDE_PREFIX)
# OS_
if (OS_LINUX)
set (JEMALLOC_INCLUDE_PREFIX "include_linux")
elseif (OS_FREEBSD)
set (JEMALLOC_INCLUDE_PREFIX "include_freebsd")
elseif (OS_DARWIN)
set (JEMALLOC_INCLUDE_PREFIX "include_darwin")
else ()
message (FATAL_ERROR "internal jemalloc: This OS is not supported")
endif ()
# ARCH_
if (ARCH_AMD64)
set(JEMALLOC_INCLUDE_PREFIX "${JEMALLOC_INCLUDE_PREFIX}_x86_64")
elseif (ARCH_ARM)
set(JEMALLOC_INCLUDE_PREFIX "${JEMALLOC_INCLUDE_PREFIX}_aarch64")
else ()
message (FATAL_ERROR "internal jemalloc: This arch is not supported")
endif ()
configure_file(${JEMALLOC_INCLUDE_PREFIX}/jemalloc/internal/jemalloc_internal_defs.h.in
${JEMALLOC_INCLUDE_PREFIX}/jemalloc/internal/jemalloc_internal_defs.h)
target_include_directories(jemalloc SYSTEM PRIVATE
${CMAKE_CURRENT_BINARY_DIR}/${JEMALLOC_INCLUDE_PREFIX}/jemalloc/internal)
target_compile_definitions(jemalloc PRIVATE -DJEMALLOC_NO_PRIVATE_NAMESPACE)
if (CMAKE_BUILD_TYPE_UC STREQUAL "DEBUG")
target_compile_definitions(jemalloc PRIVATE -DJEMALLOC_DEBUG=1 -DJEMALLOC_PROF=1)
if (USE_UNWIND)
target_compile_definitions (jemalloc PRIVATE -DJEMALLOC_PROF_LIBUNWIND=1)
target_link_libraries (jemalloc PRIVATE unwind)
endif () endif ()
endif () endif ()
set_property(TARGET jemalloc APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS USE_JEMALLOC=1) target_compile_options(jemalloc PRIVATE -Wno-redundant-decls)
if (MAKE_STATIC_LIBRARIES) # for RTLD_NEXT
# To detect whether we need to register jemalloc for osx as default zone. target_compile_options(jemalloc PRIVATE -D_GNU_SOURCE)
set_property(TARGET jemalloc APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS BUNDLED_STATIC_JEMALLOC=1)
endif()
message (STATUS "Using jemalloc") set (USE_INTERNAL_JEMALLOC_LIBRARY 1)
else ()
add_library(jemalloc INTERFACE)
target_compile_definitions(jemalloc INTERFACE USE_JEMALLOC=0)
message (STATUS "Not using jemalloc")
endif () endif ()
set_property(TARGET jemalloc APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS USE_JEMALLOC=1)
if (MAKE_STATIC_LIBRARIES)
# To detect whether we need to register jemalloc for osx as default zone.
set_property(TARGET jemalloc APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS BUNDLED_STATIC_JEMALLOC=1)
endif()
message (STATUS "Using jemalloc")

View File

@ -1,35 +1,38 @@
option (ENABLE_CPUID "Enable libcpuid library (only internal)" ${ENABLE_LIBRARIES}) option (ENABLE_CPUID "Enable libcpuid library (only internal)" ${ENABLE_LIBRARIES})
if (ARCH_ARM) if (ARCH_ARM AND ENABLE_CPUID)
message (${RECONFIGURE_MESSAGE_LEVEL} "cpuid is not supported on ARM")
set (ENABLE_CPUID 0) set (ENABLE_CPUID 0)
endif () endif ()
if (ENABLE_CPUID) if (NOT ENABLE_CPUID)
set (LIBRARY_DIR ${ClickHouse_SOURCE_DIR}/contrib/libcpuid)
set (SRCS
${LIBRARY_DIR}/libcpuid/asm-bits.c
${LIBRARY_DIR}/libcpuid/cpuid_main.c
${LIBRARY_DIR}/libcpuid/libcpuid_util.c
${LIBRARY_DIR}/libcpuid/msrdriver.c
${LIBRARY_DIR}/libcpuid/rdmsr.c
${LIBRARY_DIR}/libcpuid/rdtsc.c
${LIBRARY_DIR}/libcpuid/recog_amd.c
${LIBRARY_DIR}/libcpuid/recog_intel.c
)
add_library (cpuid ${SRCS})
target_include_directories (cpuid SYSTEM PUBLIC ${LIBRARY_DIR})
target_compile_definitions (cpuid PUBLIC USE_CPUID=1)
target_compile_definitions (cpuid PRIVATE VERSION="v0.4.1")
if (COMPILER_CLANG)
target_compile_options (cpuid PRIVATE -Wno-reserved-id-macro)
endif ()
message (STATUS "Using cpuid")
else ()
add_library (cpuid INTERFACE) add_library (cpuid INTERFACE)
target_compile_definitions (cpuid INTERFACE USE_CPUID=0) target_compile_definitions (cpuid INTERFACE USE_CPUID=0)
return()
endif()
set (LIBRARY_DIR "${ClickHouse_SOURCE_DIR}/contrib/libcpuid")
set (SRCS
${LIBRARY_DIR}/libcpuid/asm-bits.c
${LIBRARY_DIR}/libcpuid/cpuid_main.c
${LIBRARY_DIR}/libcpuid/libcpuid_util.c
${LIBRARY_DIR}/libcpuid/msrdriver.c
${LIBRARY_DIR}/libcpuid/rdmsr.c
${LIBRARY_DIR}/libcpuid/rdtsc.c
${LIBRARY_DIR}/libcpuid/recog_amd.c
${LIBRARY_DIR}/libcpuid/recog_intel.c
)
add_library (cpuid ${SRCS})
target_include_directories (cpuid SYSTEM PUBLIC ${LIBRARY_DIR})
target_compile_definitions (cpuid PUBLIC USE_CPUID=1)
target_compile_definitions (cpuid PRIVATE VERSION="v0.4.1")
if (COMPILER_CLANG)
target_compile_options (cpuid PRIVATE -Wno-reserved-id-macro)
endif () endif ()
message (STATUS "Using cpuid")

View File

@ -1,4 +1,12 @@
if (NOT USE_INTERNAL_PROTOBUF_LIBRARY) option(PROTOBUF_OLD_ABI_COMPAT "Set to ON for compatiability with external protobuf which was compiled old C++ ABI" ON)
if (PROTOBUF_OLD_ABI_COMPAT)
if (NOT ENABLE_PROTOBUF OR USE_INTERNAL_PROTOBUF_LIBRARY)
message (${RECONFIGURE_MESSAGE_LEVEL} "PROTOBUF_OLD_ABI_COMPAT option is ignored")
endif()
endif()
if (NOT USE_INTERNAL_PROTOBUF_LIBRARY AND PROTOBUF_OLD_ABI_COMPAT)
# compatiable with protobuf which was compiled old C++ ABI # compatiable with protobuf which was compiled old C++ ABI
set(CMAKE_CXX_FLAGS "-D_GLIBCXX_USE_CXX11_ABI=0") set(CMAKE_CXX_FLAGS "-D_GLIBCXX_USE_CXX11_ABI=0")
set(CMAKE_C_FLAGS "") set(CMAKE_C_FLAGS "")
@ -7,7 +15,7 @@ if (NOT USE_INTERNAL_PROTOBUF_LIBRARY)
endif () endif ()
endif() endif()
SET(WITH_KERBEROS false) set(WITH_KERBEROS false)
# project and source dir # project and source dir
set(HDFS3_ROOT_DIR ${ClickHouse_SOURCE_DIR}/contrib/libhdfs3) set(HDFS3_ROOT_DIR ${ClickHouse_SOURCE_DIR}/contrib/libhdfs3)
set(HDFS3_SOURCE_DIR ${HDFS3_ROOT_DIR}/src) set(HDFS3_SOURCE_DIR ${HDFS3_ROOT_DIR}/src)

View File

@ -1,13 +1,30 @@
option (USE_INTERNAL_LZ4_LIBRARY "Use internal lz4 library" ${NOT_UNBUNDLED}) option (USE_INTERNAL_LZ4_LIBRARY "Use internal lz4 library" ${NOT_UNBUNDLED})
if (USE_INTERNAL_LZ4_LIBRARY) if (NOT USE_INTERNAL_LZ4_LIBRARY)
set (LIBRARY_DIR ${ClickHouse_SOURCE_DIR}/contrib/lz4) find_library (LIBRARY_LZ4 lz4)
find_path (INCLUDE_LZ4 lz4.h)
if (LIBRARY_LZ4 AND INCLUDE_LZ4)
set(EXTERNAL_LZ4_LIBRARY_FOUND 1)
add_library (lz4 UNKNOWN IMPORTED)
set_property (TARGET lz4 PROPERTY IMPORTED_LOCATION ${LIBRARY_LZ4})
set_property (TARGET lz4 PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${INCLUDE_LZ4})
set_property (TARGET lz4 APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS USE_XXHASH=0)
else()
set(EXTERNAL_LZ4_LIBRARY_FOUND 0)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find system lz4")
endif()
endif()
if (NOT EXTERNAL_LZ4_LIBRARY_FOUND)
set (USE_INTERNAL_LZ4_LIBRARY 1)
set (LIBRARY_DIR "${ClickHouse_SOURCE_DIR}/contrib/lz4")
set (SRCS set (SRCS
${LIBRARY_DIR}/lib/lz4.c "${LIBRARY_DIR}/lib/lz4.c"
${LIBRARY_DIR}/lib/lz4hc.c "${LIBRARY_DIR}/lib/lz4hc.c"
${LIBRARY_DIR}/lib/lz4frame.c "${LIBRARY_DIR}/lib/lz4frame.c"
${LIBRARY_DIR}/lib/xxhash.c "${LIBRARY_DIR}/lib/xxhash.c"
) )
add_library (lz4 ${SRCS}) add_library (lz4 ${SRCS})
@ -17,12 +34,4 @@ if (USE_INTERNAL_LZ4_LIBRARY)
target_compile_options (lz4 PRIVATE -fno-sanitize=undefined) target_compile_options (lz4 PRIVATE -fno-sanitize=undefined)
endif () endif ()
target_include_directories(lz4 PUBLIC ${LIBRARY_DIR}/lib) target_include_directories(lz4 PUBLIC ${LIBRARY_DIR}/lib)
else ()
find_library (LIBRARY_LZ4 lz4)
find_path (INCLUDE_LZ4 lz4.h)
add_library (lz4 UNKNOWN IMPORTED)
set_property (TARGET lz4 PROPERTY IMPORTED_LOCATION ${LIBRARY_LZ4})
set_property (TARGET lz4 PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${INCLUDE_LZ4})
set_property (TARGET lz4 APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS USE_XXHASH=0)
endif () endif ()

View File

@ -4,6 +4,9 @@ if (USE_INTERNAL_POCO_LIBRARY)
set (LIBRARY_DIR ${ClickHouse_SOURCE_DIR}/contrib/poco) set (LIBRARY_DIR ${ClickHouse_SOURCE_DIR}/contrib/poco)
else () else ()
find_path (ROOT_DIR NAMES Foundation/include/Poco/Poco.h include/Poco/Poco.h) find_path (ROOT_DIR NAMES Foundation/include/Poco/Poco.h include/Poco/Poco.h)
if (NOT ROOT_DIR)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find system poco")
endif()
endif () endif ()
add_subdirectory (Crypto) add_subdirectory (Crypto)

View File

@ -1,35 +1,26 @@
option (ENABLE_REPLXX "Enable replxx support" ${ENABLE_LIBRARIES}) option (ENABLE_REPLXX "Enable replxx support" ${ENABLE_LIBRARIES})
if (ENABLE_REPLXX) if (NOT ENABLE_REPLXX)
option (USE_INTERNAL_REPLXX "Use internal replxx library" ${NOT_UNBUNDLED}) if (USE_INTERNAL_REPLXX_LIBRARY)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't use internal replxx with ENABLE_REPLXX=OFF")
endif()
if (USE_INTERNAL_REPLXX) add_library(replxx INTERFACE)
set (LIBRARY_DIR "${ClickHouse_SOURCE_DIR}/contrib/replxx") target_compile_definitions(replxx INTERFACE USE_REPLXX=0)
set(SRCS message (STATUS "Not using replxx (Beware! Runtime fallback to readline is possible!)")
${LIBRARY_DIR}/src/conversion.cxx return()
${LIBRARY_DIR}/src/ConvertUTF.cpp endif()
${LIBRARY_DIR}/src/escape.cxx
${LIBRARY_DIR}/src/history.cxx
${LIBRARY_DIR}/src/io.cxx
${LIBRARY_DIR}/src/prompt.cxx
${LIBRARY_DIR}/src/replxx_impl.cxx
${LIBRARY_DIR}/src/replxx.cxx
${LIBRARY_DIR}/src/util.cxx
${LIBRARY_DIR}/src/wcwidth.cpp
)
add_library (replxx ${SRCS}) option (USE_INTERNAL_REPLXX_LIBRARY "Use internal replxx library" ${NOT_UNBUNDLED})
target_include_directories(replxx SYSTEM PUBLIC ${LIBRARY_DIR}/include)
else ()
find_library(LIBRARY_REPLXX NAMES replxx replxx-static)
find_path(INCLUDE_REPLXX replxx.hxx)
add_library(replxx UNKNOWN IMPORTED) if (NOT USE_INTERNAL_REPLXX_LIBRARY)
set_property(TARGET replxx PROPERTY IMPORTED_LOCATION ${LIBRARY_REPLXX}) find_library(LIBRARY_REPLXX NAMES replxx replxx-static)
target_include_directories(replxx SYSTEM PUBLIC ${INCLUDE_REPLXX}) find_path(INCLUDE_REPLXX replxx.hxx)
set(CMAKE_REQUIRED_LIBRARIES replxx) if (LIBRARY_REPLXX AND INCLUDE_REPLXX)
set(CMAKE_REQUIRED_LIBRARIES ${LIBRARY_REPLXX})
set(CMAKE_REQUIRED_INCLUDES ${INCLUDE_REPLXX})
check_cxx_source_compiles( check_cxx_source_compiles(
" "
#include <replxx.hxx> #include <replxx.hxx>
@ -41,20 +32,43 @@ if (ENABLE_REPLXX)
) )
if (NOT EXTERNAL_REPLXX_WORKS) if (NOT EXTERNAL_REPLXX_WORKS)
message (FATAL_ERROR "replxx is unusable: ${LIBRARY_REPLXX} ${INCLUDE_REPLXX}") message (${RECONFIGURE_MESSAGE_LEVEL} "replxx is unusable: ${LIBRARY_REPLXX} ${INCLUDE_REPLXX}")
endif () else()
endif () add_library(replxx UNKNOWN IMPORTED)
set_property(TARGET replxx PROPERTY IMPORTED_LOCATION ${LIBRARY_REPLXX})
target_include_directories(replxx SYSTEM PUBLIC ${INCLUDE_REPLXX})
endif()
else()
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find system replxx")
endif()
endif()
if (COMPILER_CLANG)
target_compile_options(replxx PRIVATE -Wno-documentation)
endif ()
target_compile_definitions(replxx PUBLIC USE_REPLXX=1) if (NOT LIBRARY_REPLXX OR NOT INCLUDE_REPLXX OR NOT EXTERNAL_REPLXX_WORKS)
set(USE_INTERNAL_REPLXX_LIBRARY 1)
set (LIBRARY_DIR "${ClickHouse_SOURCE_DIR}/contrib/replxx")
message (STATUS "Using replxx") set(SRCS
else () ${LIBRARY_DIR}/src/conversion.cxx
add_library(replxx INTERFACE) ${LIBRARY_DIR}/src/ConvertUTF.cpp
target_compile_definitions(replxx INTERFACE USE_REPLXX=0) ${LIBRARY_DIR}/src/escape.cxx
${LIBRARY_DIR}/src/history.cxx
${LIBRARY_DIR}/src/io.cxx
${LIBRARY_DIR}/src/prompt.cxx
${LIBRARY_DIR}/src/replxx_impl.cxx
${LIBRARY_DIR}/src/replxx.cxx
${LIBRARY_DIR}/src/util.cxx
${LIBRARY_DIR}/src/wcwidth.cpp
)
message (STATUS "Not using replxx (Beware! Runtime fallback to readline is possible!)") add_library (replxx ${SRCS})
target_include_directories(replxx SYSTEM PUBLIC ${LIBRARY_DIR}/include)
endif () endif ()
if (COMPILER_CLANG)
target_compile_options(replxx PRIVATE -Wno-documentation)
endif ()
target_compile_definitions(replxx PUBLIC USE_REPLXX=1)
message (STATUS "Using replxx")

View File

@ -1,318 +1,336 @@
option (ENABLE_ODBC "Enable ODBC library" ${ENABLE_LIBRARIES}) option (ENABLE_ODBC "Enable ODBC library" ${ENABLE_LIBRARIES})
if (NOT OS_LINUX) if (NOT OS_LINUX)
if (ENABLE_ODBC)
message(STATUS "ODBC is only supported on Linux")
endif()
set (ENABLE_ODBC OFF CACHE INTERNAL "") set (ENABLE_ODBC OFF CACHE INTERNAL "")
endif () endif ()
if (ENABLE_ODBC) if (NOT ENABLE_ODBC)
option (USE_INTERNAL_ODBC_LIBRARY "Use internal ODBC library" ${NOT_UNBUNDLED})
if (USE_INTERNAL_ODBC_LIBRARY) if (USE_INTERNAL_ODBC_LIBRARY)
set (LIBRARY_DIR ${ClickHouse_SOURCE_DIR}/contrib/unixodbc) message (${RECONFIGURE_MESSAGE_LEVEL} "Can't use internal ODBC with ENABLE_ODBC=OFF")
endif()
# ltdl
set (SRCS_LTDL
# This file is generated by 'libtool' inside libltdl directory and then removed.
linux_x86_64/libltdl/libltdlcS.c
${LIBRARY_DIR}/libltdl/lt__alloc.c
${LIBRARY_DIR}/libltdl/lt__strl.c
${LIBRARY_DIR}/libltdl/ltdl.c
${LIBRARY_DIR}/libltdl/lt_dlloader.c
${LIBRARY_DIR}/libltdl/slist.c
${LIBRARY_DIR}/libltdl/lt_error.c
${LIBRARY_DIR}/libltdl/loaders/dlopen.c
${LIBRARY_DIR}/libltdl/loaders/preopen.c
)
add_library (ltdl ${SRCS_LTDL})
target_include_directories(ltdl
PRIVATE
linux_x86_64/libltdl
PUBLIC
${LIBRARY_DIR}/libltdl
${LIBRARY_DIR}/libltdl/libltdl
)
target_compile_definitions(ltdl PRIVATE -DHAVE_CONFIG_H -DLTDL -DLTDLOPEN=libltdlc)
target_compile_options(ltdl PRIVATE -Wno-constant-logical-operand -Wno-unknown-warning-option -O2)
# odbc
set (SRCS
${LIBRARY_DIR}/DriverManager/__attribute.c
${LIBRARY_DIR}/DriverManager/__connection.c
${LIBRARY_DIR}/DriverManager/__handles.c
${LIBRARY_DIR}/DriverManager/__info.c
${LIBRARY_DIR}/DriverManager/__stats.c
${LIBRARY_DIR}/DriverManager/SQLAllocConnect.c
${LIBRARY_DIR}/DriverManager/SQLAllocEnv.c
${LIBRARY_DIR}/DriverManager/SQLAllocHandle.c
${LIBRARY_DIR}/DriverManager/SQLAllocHandleStd.c
${LIBRARY_DIR}/DriverManager/SQLAllocStmt.c
${LIBRARY_DIR}/DriverManager/SQLBindCol.c
${LIBRARY_DIR}/DriverManager/SQLBindParam.c
${LIBRARY_DIR}/DriverManager/SQLBindParameter.c
${LIBRARY_DIR}/DriverManager/SQLBrowseConnect.c
${LIBRARY_DIR}/DriverManager/SQLBrowseConnectW.c
${LIBRARY_DIR}/DriverManager/SQLBulkOperations.c
${LIBRARY_DIR}/DriverManager/SQLCancel.c
${LIBRARY_DIR}/DriverManager/SQLCancelHandle.c
${LIBRARY_DIR}/DriverManager/SQLCloseCursor.c
${LIBRARY_DIR}/DriverManager/SQLColAttribute.c
${LIBRARY_DIR}/DriverManager/SQLColAttributes.c
${LIBRARY_DIR}/DriverManager/SQLColAttributesW.c
${LIBRARY_DIR}/DriverManager/SQLColAttributeW.c
${LIBRARY_DIR}/DriverManager/SQLColumnPrivileges.c
${LIBRARY_DIR}/DriverManager/SQLColumnPrivilegesW.c
${LIBRARY_DIR}/DriverManager/SQLColumns.c
${LIBRARY_DIR}/DriverManager/SQLColumnsW.c
${LIBRARY_DIR}/DriverManager/SQLConnect.c
${LIBRARY_DIR}/DriverManager/SQLConnectW.c
${LIBRARY_DIR}/DriverManager/SQLCopyDesc.c
${LIBRARY_DIR}/DriverManager/SQLDataSources.c
${LIBRARY_DIR}/DriverManager/SQLDataSourcesW.c
${LIBRARY_DIR}/DriverManager/SQLDescribeCol.c
${LIBRARY_DIR}/DriverManager/SQLDescribeColW.c
${LIBRARY_DIR}/DriverManager/SQLDescribeParam.c
${LIBRARY_DIR}/DriverManager/SQLDisconnect.c
${LIBRARY_DIR}/DriverManager/SQLDriverConnect.c
${LIBRARY_DIR}/DriverManager/SQLDriverConnectW.c
${LIBRARY_DIR}/DriverManager/SQLDrivers.c
${LIBRARY_DIR}/DriverManager/SQLDriversW.c
${LIBRARY_DIR}/DriverManager/SQLEndTran.c
${LIBRARY_DIR}/DriverManager/SQLError.c
${LIBRARY_DIR}/DriverManager/SQLErrorW.c
${LIBRARY_DIR}/DriverManager/SQLExecDirect.c
${LIBRARY_DIR}/DriverManager/SQLExecDirectW.c
${LIBRARY_DIR}/DriverManager/SQLExecute.c
${LIBRARY_DIR}/DriverManager/SQLExtendedFetch.c
${LIBRARY_DIR}/DriverManager/SQLFetch.c
${LIBRARY_DIR}/DriverManager/SQLFetchScroll.c
${LIBRARY_DIR}/DriverManager/SQLForeignKeys.c
${LIBRARY_DIR}/DriverManager/SQLForeignKeysW.c
${LIBRARY_DIR}/DriverManager/SQLFreeConnect.c
${LIBRARY_DIR}/DriverManager/SQLFreeEnv.c
${LIBRARY_DIR}/DriverManager/SQLFreeHandle.c
${LIBRARY_DIR}/DriverManager/SQLFreeStmt.c
${LIBRARY_DIR}/DriverManager/SQLGetConnectAttr.c
${LIBRARY_DIR}/DriverManager/SQLGetConnectAttrW.c
${LIBRARY_DIR}/DriverManager/SQLGetConnectOption.c
${LIBRARY_DIR}/DriverManager/SQLGetConnectOptionW.c
${LIBRARY_DIR}/DriverManager/SQLGetCursorName.c
${LIBRARY_DIR}/DriverManager/SQLGetCursorNameW.c
${LIBRARY_DIR}/DriverManager/SQLGetData.c
${LIBRARY_DIR}/DriverManager/SQLGetDescField.c
${LIBRARY_DIR}/DriverManager/SQLGetDescFieldW.c
${LIBRARY_DIR}/DriverManager/SQLGetDescRec.c
${LIBRARY_DIR}/DriverManager/SQLGetDescRecW.c
${LIBRARY_DIR}/DriverManager/SQLGetDiagField.c
${LIBRARY_DIR}/DriverManager/SQLGetDiagFieldW.c
${LIBRARY_DIR}/DriverManager/SQLGetDiagRec.c
${LIBRARY_DIR}/DriverManager/SQLGetDiagRecW.c
${LIBRARY_DIR}/DriverManager/SQLGetEnvAttr.c
${LIBRARY_DIR}/DriverManager/SQLGetFunctions.c
${LIBRARY_DIR}/DriverManager/SQLGetInfo.c
${LIBRARY_DIR}/DriverManager/SQLGetInfoW.c
${LIBRARY_DIR}/DriverManager/SQLGetStmtAttr.c
${LIBRARY_DIR}/DriverManager/SQLGetStmtAttrW.c
${LIBRARY_DIR}/DriverManager/SQLGetStmtOption.c
${LIBRARY_DIR}/DriverManager/SQLGetTypeInfo.c
${LIBRARY_DIR}/DriverManager/SQLGetTypeInfoW.c
${LIBRARY_DIR}/DriverManager/SQLMoreResults.c
${LIBRARY_DIR}/DriverManager/SQLNativeSql.c
${LIBRARY_DIR}/DriverManager/SQLNativeSqlW.c
${LIBRARY_DIR}/DriverManager/SQLNumParams.c
${LIBRARY_DIR}/DriverManager/SQLNumResultCols.c
${LIBRARY_DIR}/DriverManager/SQLParamData.c
${LIBRARY_DIR}/DriverManager/SQLParamOptions.c
${LIBRARY_DIR}/DriverManager/SQLPrepare.c
${LIBRARY_DIR}/DriverManager/SQLPrepareW.c
${LIBRARY_DIR}/DriverManager/SQLPrimaryKeys.c
${LIBRARY_DIR}/DriverManager/SQLPrimaryKeysW.c
${LIBRARY_DIR}/DriverManager/SQLProcedureColumns.c
${LIBRARY_DIR}/DriverManager/SQLProcedureColumnsW.c
${LIBRARY_DIR}/DriverManager/SQLProcedures.c
${LIBRARY_DIR}/DriverManager/SQLProceduresW.c
${LIBRARY_DIR}/DriverManager/SQLPutData.c
${LIBRARY_DIR}/DriverManager/SQLRowCount.c
${LIBRARY_DIR}/DriverManager/SQLSetConnectAttr.c
${LIBRARY_DIR}/DriverManager/SQLSetConnectAttrW.c
${LIBRARY_DIR}/DriverManager/SQLSetConnectOption.c
${LIBRARY_DIR}/DriverManager/SQLSetConnectOptionW.c
${LIBRARY_DIR}/DriverManager/SQLSetCursorName.c
${LIBRARY_DIR}/DriverManager/SQLSetCursorNameW.c
${LIBRARY_DIR}/DriverManager/SQLSetDescField.c
${LIBRARY_DIR}/DriverManager/SQLSetDescFieldW.c
${LIBRARY_DIR}/DriverManager/SQLSetDescRec.c
${LIBRARY_DIR}/DriverManager/SQLSetEnvAttr.c
${LIBRARY_DIR}/DriverManager/SQLSetParam.c
${LIBRARY_DIR}/DriverManager/SQLSetPos.c
${LIBRARY_DIR}/DriverManager/SQLSetScrollOptions.c
${LIBRARY_DIR}/DriverManager/SQLSetStmtAttr.c
${LIBRARY_DIR}/DriverManager/SQLSetStmtAttrW.c
${LIBRARY_DIR}/DriverManager/SQLSetStmtOption.c
${LIBRARY_DIR}/DriverManager/SQLSetStmtOptionW.c
${LIBRARY_DIR}/DriverManager/SQLSpecialColumns.c
${LIBRARY_DIR}/DriverManager/SQLSpecialColumnsW.c
${LIBRARY_DIR}/DriverManager/SQLStatistics.c
${LIBRARY_DIR}/DriverManager/SQLStatisticsW.c
${LIBRARY_DIR}/DriverManager/SQLTablePrivileges.c
${LIBRARY_DIR}/DriverManager/SQLTablePrivilegesW.c
${LIBRARY_DIR}/DriverManager/SQLTables.c
${LIBRARY_DIR}/DriverManager/SQLTablesW.c
${LIBRARY_DIR}/DriverManager/SQLTransact.c
${LIBRARY_DIR}/ini/_iniDump.c
${LIBRARY_DIR}/ini/_iniObjectRead.c
${LIBRARY_DIR}/ini/_iniPropertyRead.c
${LIBRARY_DIR}/ini/_iniScanUntilObject.c
${LIBRARY_DIR}/ini/iniAllTrim.c
${LIBRARY_DIR}/ini/iniAppend.c
${LIBRARY_DIR}/ini/iniClose.c
${LIBRARY_DIR}/ini/iniCommit.c
${LIBRARY_DIR}/ini/iniCursor.c
${LIBRARY_DIR}/ini/iniDelete.c
${LIBRARY_DIR}/ini/iniElement.c
${LIBRARY_DIR}/ini/iniElementCount.c
${LIBRARY_DIR}/ini/iniGetBookmark.c
${LIBRARY_DIR}/ini/iniGotoBookmark.c
${LIBRARY_DIR}/ini/iniObject.c
${LIBRARY_DIR}/ini/iniObjectDelete.c
${LIBRARY_DIR}/ini/iniObjectEOL.c
${LIBRARY_DIR}/ini/iniObjectFirst.c
${LIBRARY_DIR}/ini/iniObjectInsert.c
${LIBRARY_DIR}/ini/iniObjectLast.c
${LIBRARY_DIR}/ini/iniObjectNext.c
${LIBRARY_DIR}/ini/iniObjectSeek.c
${LIBRARY_DIR}/ini/iniObjectSeekSure.c
${LIBRARY_DIR}/ini/iniObjectUpdate.c
${LIBRARY_DIR}/ini/iniOpen.c
${LIBRARY_DIR}/ini/iniProperty.c
${LIBRARY_DIR}/ini/iniPropertyDelete.c
${LIBRARY_DIR}/ini/iniPropertyEOL.c
${LIBRARY_DIR}/ini/iniPropertyFirst.c
${LIBRARY_DIR}/ini/iniPropertyInsert.c
${LIBRARY_DIR}/ini/iniPropertyLast.c
${LIBRARY_DIR}/ini/iniPropertyNext.c
${LIBRARY_DIR}/ini/iniPropertySeek.c
${LIBRARY_DIR}/ini/iniPropertySeekSure.c
${LIBRARY_DIR}/ini/iniPropertyUpdate.c
${LIBRARY_DIR}/ini/iniPropertyValue.c
${LIBRARY_DIR}/ini/iniToUpper.c
${LIBRARY_DIR}/ini/iniValue.c
${LIBRARY_DIR}/log/_logFreeMsg.c
${LIBRARY_DIR}/log/logClear.c
${LIBRARY_DIR}/log/logClose.c
${LIBRARY_DIR}/log/logOn.c
${LIBRARY_DIR}/log/logOpen.c
${LIBRARY_DIR}/log/logPeekMsg.c
${LIBRARY_DIR}/log/logPopMsg.c
${LIBRARY_DIR}/log/logPushMsg.c
${LIBRARY_DIR}/lst/_lstAdjustCurrent.c
${LIBRARY_DIR}/lst/_lstDump.c
${LIBRARY_DIR}/lst/_lstFreeItem.c
${LIBRARY_DIR}/lst/_lstNextValidItem.c
${LIBRARY_DIR}/lst/_lstPrevValidItem.c
${LIBRARY_DIR}/lst/_lstVisible.c
${LIBRARY_DIR}/lst/lstAppend.c
${LIBRARY_DIR}/lst/lstClose.c
${LIBRARY_DIR}/lst/lstDelete.c
${LIBRARY_DIR}/lst/lstEOL.c
${LIBRARY_DIR}/lst/lstFirst.c
${LIBRARY_DIR}/lst/lstGet.c
${LIBRARY_DIR}/lst/lstGetBookMark.c
${LIBRARY_DIR}/lst/lstGoto.c
${LIBRARY_DIR}/lst/lstGotoBookMark.c
${LIBRARY_DIR}/lst/lstInsert.c
${LIBRARY_DIR}/lst/lstLast.c
${LIBRARY_DIR}/lst/lstNext.c
${LIBRARY_DIR}/lst/lstOpen.c
${LIBRARY_DIR}/lst/lstOpenCursor.c
${LIBRARY_DIR}/lst/lstPrev.c
${LIBRARY_DIR}/lst/lstSeek.c
${LIBRARY_DIR}/lst/lstSeekItem.c
${LIBRARY_DIR}/lst/lstSet.c
${LIBRARY_DIR}/lst/lstSetFreeFunc.c
${LIBRARY_DIR}/odbcinst/_logging.c
${LIBRARY_DIR}/odbcinst/_odbcinst_ConfigModeINI.c
${LIBRARY_DIR}/odbcinst/_odbcinst_GetEntries.c
${LIBRARY_DIR}/odbcinst/_odbcinst_GetSections.c
${LIBRARY_DIR}/odbcinst/_odbcinst_SystemINI.c
${LIBRARY_DIR}/odbcinst/_odbcinst_UserINI.c
${LIBRARY_DIR}/odbcinst/_SQLDriverConnectPrompt.c
${LIBRARY_DIR}/odbcinst/_SQLGetInstalledDrivers.c
${LIBRARY_DIR}/odbcinst/_SQLWriteInstalledDrivers.c
${LIBRARY_DIR}/odbcinst/ODBCINSTConstructProperties.c
${LIBRARY_DIR}/odbcinst/ODBCINSTDestructProperties.c
${LIBRARY_DIR}/odbcinst/ODBCINSTSetProperty.c
${LIBRARY_DIR}/odbcinst/ODBCINSTValidateProperties.c
${LIBRARY_DIR}/odbcinst/ODBCINSTValidateProperty.c
${LIBRARY_DIR}/odbcinst/SQLConfigDataSource.c
${LIBRARY_DIR}/odbcinst/SQLConfigDriver.c
${LIBRARY_DIR}/odbcinst/SQLCreateDataSource.c
${LIBRARY_DIR}/odbcinst/SQLGetAvailableDrivers.c
${LIBRARY_DIR}/odbcinst/SQLGetConfigMode.c
${LIBRARY_DIR}/odbcinst/SQLGetInstalledDrivers.c
${LIBRARY_DIR}/odbcinst/SQLGetPrivateProfileString.c
${LIBRARY_DIR}/odbcinst/SQLGetTranslator.c
${LIBRARY_DIR}/odbcinst/SQLInstallDriverEx.c
${LIBRARY_DIR}/odbcinst/SQLInstallDriverManager.c
${LIBRARY_DIR}/odbcinst/SQLInstallerError.c
${LIBRARY_DIR}/odbcinst/SQLInstallODBC.c
${LIBRARY_DIR}/odbcinst/SQLInstallTranslatorEx.c
${LIBRARY_DIR}/odbcinst/SQLManageDataSources.c
${LIBRARY_DIR}/odbcinst/SQLPostInstallerError.c
${LIBRARY_DIR}/odbcinst/SQLReadFileDSN.c
${LIBRARY_DIR}/odbcinst/SQLRemoveDriver.c
${LIBRARY_DIR}/odbcinst/SQLRemoveDriverManager.c
${LIBRARY_DIR}/odbcinst/SQLRemoveDSNFromIni.c
${LIBRARY_DIR}/odbcinst/SQLRemoveTranslator.c
${LIBRARY_DIR}/odbcinst/SQLSetConfigMode.c
${LIBRARY_DIR}/odbcinst/SQLValidDSN.c
${LIBRARY_DIR}/odbcinst/SQLWriteDSNToIni.c
${LIBRARY_DIR}/odbcinst/SQLWriteFileDSN.c
${LIBRARY_DIR}/odbcinst/SQLWritePrivateProfileString.c
)
add_library (unixodbc ${SRCS})
target_link_libraries (unixodbc PRIVATE ltdl)
# SYSTEM_FILE_PATH was changed to /etc
target_include_directories (unixodbc
PRIVATE
linux_x86_64/private
PUBLIC
linux_x86_64
${LIBRARY_DIR}/include
)
target_compile_definitions (unixodbc PRIVATE -DHAVE_CONFIG_H)
target_compile_options (unixodbc
PRIVATE
-Wno-dangling-else
-Wno-parentheses
-Wno-misleading-indentation
-Wno-unknown-warning-option
-Wno-reserved-id-macro
-O2
)
else ()
add_library (unixodbc UNKNOWN IMPORTED)
find_library (LIBRARY_ODBC unixodbc)
find_path (INCLUDE_ODBC sql.h)
set_target_properties (unixodbc PROPERTIES IMPORTED_LOCATION ${LIBRARY_ODBC})
set_target_properties (unixodbc PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${INCLUDE_ODBC})
endif ()
target_compile_definitions (unixodbc INTERFACE USE_ODBC=1)
message (STATUS "Using unixodbc")
else ()
add_library (unixodbc INTERFACE) add_library (unixodbc INTERFACE)
target_compile_definitions (unixodbc INTERFACE USE_ODBC=0) target_compile_definitions (unixodbc INTERFACE USE_ODBC=0)
message (STATUS "Not using unixodbc") message (STATUS "Not using unixodbc")
return()
endif()
option (USE_INTERNAL_ODBC_LIBRARY "Use internal ODBC library" ${NOT_UNBUNDLED})
if (NOT USE_INTERNAL_ODBC_LIBRARY)
find_library (LIBRARY_ODBC unixodbc)
find_path (INCLUDE_ODBC sql.h)
if(LIBRARY_ODBC AND INCLUDE_ODBC)
add_library (unixodbc UNKNOWN IMPORTED)
set_target_properties (unixodbc PROPERTIES IMPORTED_LOCATION ${LIBRARY_ODBC})
set_target_properties (unixodbc PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${INCLUDE_ODBC})
set(EXTERNAL_ODBC_LIBRARY_FOUND 1)
else()
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find system ODBC library")
set(EXTERNAL_ODBC_LIBRARY_FOUND 0)
endif()
endif()
if (NOT EXTERNAL_ODBC_LIBRARY_FOUND)
set (USE_INTERNAL_ODBC_LIBRARY 1)
set (LIBRARY_DIR ${ClickHouse_SOURCE_DIR}/contrib/unixodbc)
# ltdl
set (SRCS_LTDL
# This file is generated by 'libtool' inside libltdl directory and then removed.
linux_x86_64/libltdl/libltdlcS.c
${LIBRARY_DIR}/libltdl/lt__alloc.c
${LIBRARY_DIR}/libltdl/lt__strl.c
${LIBRARY_DIR}/libltdl/ltdl.c
${LIBRARY_DIR}/libltdl/lt_dlloader.c
${LIBRARY_DIR}/libltdl/slist.c
${LIBRARY_DIR}/libltdl/lt_error.c
${LIBRARY_DIR}/libltdl/loaders/dlopen.c
${LIBRARY_DIR}/libltdl/loaders/preopen.c
)
add_library (ltdl ${SRCS_LTDL})
target_include_directories(ltdl
PRIVATE
linux_x86_64/libltdl
PUBLIC
${LIBRARY_DIR}/libltdl
${LIBRARY_DIR}/libltdl/libltdl
)
target_compile_definitions(ltdl PRIVATE -DHAVE_CONFIG_H -DLTDL -DLTDLOPEN=libltdlc)
target_compile_options(ltdl PRIVATE -Wno-constant-logical-operand -Wno-unknown-warning-option -O2)
# odbc
set (SRCS
${LIBRARY_DIR}/DriverManager/__attribute.c
${LIBRARY_DIR}/DriverManager/__connection.c
${LIBRARY_DIR}/DriverManager/__handles.c
${LIBRARY_DIR}/DriverManager/__info.c
${LIBRARY_DIR}/DriverManager/__stats.c
${LIBRARY_DIR}/DriverManager/SQLAllocConnect.c
${LIBRARY_DIR}/DriverManager/SQLAllocEnv.c
${LIBRARY_DIR}/DriverManager/SQLAllocHandle.c
${LIBRARY_DIR}/DriverManager/SQLAllocHandleStd.c
${LIBRARY_DIR}/DriverManager/SQLAllocStmt.c
${LIBRARY_DIR}/DriverManager/SQLBindCol.c
${LIBRARY_DIR}/DriverManager/SQLBindParam.c
${LIBRARY_DIR}/DriverManager/SQLBindParameter.c
${LIBRARY_DIR}/DriverManager/SQLBrowseConnect.c
${LIBRARY_DIR}/DriverManager/SQLBrowseConnectW.c
${LIBRARY_DIR}/DriverManager/SQLBulkOperations.c
${LIBRARY_DIR}/DriverManager/SQLCancel.c
${LIBRARY_DIR}/DriverManager/SQLCancelHandle.c
${LIBRARY_DIR}/DriverManager/SQLCloseCursor.c
${LIBRARY_DIR}/DriverManager/SQLColAttribute.c
${LIBRARY_DIR}/DriverManager/SQLColAttributes.c
${LIBRARY_DIR}/DriverManager/SQLColAttributesW.c
${LIBRARY_DIR}/DriverManager/SQLColAttributeW.c
${LIBRARY_DIR}/DriverManager/SQLColumnPrivileges.c
${LIBRARY_DIR}/DriverManager/SQLColumnPrivilegesW.c
${LIBRARY_DIR}/DriverManager/SQLColumns.c
${LIBRARY_DIR}/DriverManager/SQLColumnsW.c
${LIBRARY_DIR}/DriverManager/SQLConnect.c
${LIBRARY_DIR}/DriverManager/SQLConnectW.c
${LIBRARY_DIR}/DriverManager/SQLCopyDesc.c
${LIBRARY_DIR}/DriverManager/SQLDataSources.c
${LIBRARY_DIR}/DriverManager/SQLDataSourcesW.c
${LIBRARY_DIR}/DriverManager/SQLDescribeCol.c
${LIBRARY_DIR}/DriverManager/SQLDescribeColW.c
${LIBRARY_DIR}/DriverManager/SQLDescribeParam.c
${LIBRARY_DIR}/DriverManager/SQLDisconnect.c
${LIBRARY_DIR}/DriverManager/SQLDriverConnect.c
${LIBRARY_DIR}/DriverManager/SQLDriverConnectW.c
${LIBRARY_DIR}/DriverManager/SQLDrivers.c
${LIBRARY_DIR}/DriverManager/SQLDriversW.c
${LIBRARY_DIR}/DriverManager/SQLEndTran.c
${LIBRARY_DIR}/DriverManager/SQLError.c
${LIBRARY_DIR}/DriverManager/SQLErrorW.c
${LIBRARY_DIR}/DriverManager/SQLExecDirect.c
${LIBRARY_DIR}/DriverManager/SQLExecDirectW.c
${LIBRARY_DIR}/DriverManager/SQLExecute.c
${LIBRARY_DIR}/DriverManager/SQLExtendedFetch.c
${LIBRARY_DIR}/DriverManager/SQLFetch.c
${LIBRARY_DIR}/DriverManager/SQLFetchScroll.c
${LIBRARY_DIR}/DriverManager/SQLForeignKeys.c
${LIBRARY_DIR}/DriverManager/SQLForeignKeysW.c
${LIBRARY_DIR}/DriverManager/SQLFreeConnect.c
${LIBRARY_DIR}/DriverManager/SQLFreeEnv.c
${LIBRARY_DIR}/DriverManager/SQLFreeHandle.c
${LIBRARY_DIR}/DriverManager/SQLFreeStmt.c
${LIBRARY_DIR}/DriverManager/SQLGetConnectAttr.c
${LIBRARY_DIR}/DriverManager/SQLGetConnectAttrW.c
${LIBRARY_DIR}/DriverManager/SQLGetConnectOption.c
${LIBRARY_DIR}/DriverManager/SQLGetConnectOptionW.c
${LIBRARY_DIR}/DriverManager/SQLGetCursorName.c
${LIBRARY_DIR}/DriverManager/SQLGetCursorNameW.c
${LIBRARY_DIR}/DriverManager/SQLGetData.c
${LIBRARY_DIR}/DriverManager/SQLGetDescField.c
${LIBRARY_DIR}/DriverManager/SQLGetDescFieldW.c
${LIBRARY_DIR}/DriverManager/SQLGetDescRec.c
${LIBRARY_DIR}/DriverManager/SQLGetDescRecW.c
${LIBRARY_DIR}/DriverManager/SQLGetDiagField.c
${LIBRARY_DIR}/DriverManager/SQLGetDiagFieldW.c
${LIBRARY_DIR}/DriverManager/SQLGetDiagRec.c
${LIBRARY_DIR}/DriverManager/SQLGetDiagRecW.c
${LIBRARY_DIR}/DriverManager/SQLGetEnvAttr.c
${LIBRARY_DIR}/DriverManager/SQLGetFunctions.c
${LIBRARY_DIR}/DriverManager/SQLGetInfo.c
${LIBRARY_DIR}/DriverManager/SQLGetInfoW.c
${LIBRARY_DIR}/DriverManager/SQLGetStmtAttr.c
${LIBRARY_DIR}/DriverManager/SQLGetStmtAttrW.c
${LIBRARY_DIR}/DriverManager/SQLGetStmtOption.c
${LIBRARY_DIR}/DriverManager/SQLGetTypeInfo.c
${LIBRARY_DIR}/DriverManager/SQLGetTypeInfoW.c
${LIBRARY_DIR}/DriverManager/SQLMoreResults.c
${LIBRARY_DIR}/DriverManager/SQLNativeSql.c
${LIBRARY_DIR}/DriverManager/SQLNativeSqlW.c
${LIBRARY_DIR}/DriverManager/SQLNumParams.c
${LIBRARY_DIR}/DriverManager/SQLNumResultCols.c
${LIBRARY_DIR}/DriverManager/SQLParamData.c
${LIBRARY_DIR}/DriverManager/SQLParamOptions.c
${LIBRARY_DIR}/DriverManager/SQLPrepare.c
${LIBRARY_DIR}/DriverManager/SQLPrepareW.c
${LIBRARY_DIR}/DriverManager/SQLPrimaryKeys.c
${LIBRARY_DIR}/DriverManager/SQLPrimaryKeysW.c
${LIBRARY_DIR}/DriverManager/SQLProcedureColumns.c
${LIBRARY_DIR}/DriverManager/SQLProcedureColumnsW.c
${LIBRARY_DIR}/DriverManager/SQLProcedures.c
${LIBRARY_DIR}/DriverManager/SQLProceduresW.c
${LIBRARY_DIR}/DriverManager/SQLPutData.c
${LIBRARY_DIR}/DriverManager/SQLRowCount.c
${LIBRARY_DIR}/DriverManager/SQLSetConnectAttr.c
${LIBRARY_DIR}/DriverManager/SQLSetConnectAttrW.c
${LIBRARY_DIR}/DriverManager/SQLSetConnectOption.c
${LIBRARY_DIR}/DriverManager/SQLSetConnectOptionW.c
${LIBRARY_DIR}/DriverManager/SQLSetCursorName.c
${LIBRARY_DIR}/DriverManager/SQLSetCursorNameW.c
${LIBRARY_DIR}/DriverManager/SQLSetDescField.c
${LIBRARY_DIR}/DriverManager/SQLSetDescFieldW.c
${LIBRARY_DIR}/DriverManager/SQLSetDescRec.c
${LIBRARY_DIR}/DriverManager/SQLSetEnvAttr.c
${LIBRARY_DIR}/DriverManager/SQLSetParam.c
${LIBRARY_DIR}/DriverManager/SQLSetPos.c
${LIBRARY_DIR}/DriverManager/SQLSetScrollOptions.c
${LIBRARY_DIR}/DriverManager/SQLSetStmtAttr.c
${LIBRARY_DIR}/DriverManager/SQLSetStmtAttrW.c
${LIBRARY_DIR}/DriverManager/SQLSetStmtOption.c
${LIBRARY_DIR}/DriverManager/SQLSetStmtOptionW.c
${LIBRARY_DIR}/DriverManager/SQLSpecialColumns.c
${LIBRARY_DIR}/DriverManager/SQLSpecialColumnsW.c
${LIBRARY_DIR}/DriverManager/SQLStatistics.c
${LIBRARY_DIR}/DriverManager/SQLStatisticsW.c
${LIBRARY_DIR}/DriverManager/SQLTablePrivileges.c
${LIBRARY_DIR}/DriverManager/SQLTablePrivilegesW.c
${LIBRARY_DIR}/DriverManager/SQLTables.c
${LIBRARY_DIR}/DriverManager/SQLTablesW.c
${LIBRARY_DIR}/DriverManager/SQLTransact.c
${LIBRARY_DIR}/ini/_iniDump.c
${LIBRARY_DIR}/ini/_iniObjectRead.c
${LIBRARY_DIR}/ini/_iniPropertyRead.c
${LIBRARY_DIR}/ini/_iniScanUntilObject.c
${LIBRARY_DIR}/ini/iniAllTrim.c
${LIBRARY_DIR}/ini/iniAppend.c
${LIBRARY_DIR}/ini/iniClose.c
${LIBRARY_DIR}/ini/iniCommit.c
${LIBRARY_DIR}/ini/iniCursor.c
${LIBRARY_DIR}/ini/iniDelete.c
${LIBRARY_DIR}/ini/iniElement.c
${LIBRARY_DIR}/ini/iniElementCount.c
${LIBRARY_DIR}/ini/iniGetBookmark.c
${LIBRARY_DIR}/ini/iniGotoBookmark.c
${LIBRARY_DIR}/ini/iniObject.c
${LIBRARY_DIR}/ini/iniObjectDelete.c
${LIBRARY_DIR}/ini/iniObjectEOL.c
${LIBRARY_DIR}/ini/iniObjectFirst.c
${LIBRARY_DIR}/ini/iniObjectInsert.c
${LIBRARY_DIR}/ini/iniObjectLast.c
${LIBRARY_DIR}/ini/iniObjectNext.c
${LIBRARY_DIR}/ini/iniObjectSeek.c
${LIBRARY_DIR}/ini/iniObjectSeekSure.c
${LIBRARY_DIR}/ini/iniObjectUpdate.c
${LIBRARY_DIR}/ini/iniOpen.c
${LIBRARY_DIR}/ini/iniProperty.c
${LIBRARY_DIR}/ini/iniPropertyDelete.c
${LIBRARY_DIR}/ini/iniPropertyEOL.c
${LIBRARY_DIR}/ini/iniPropertyFirst.c
${LIBRARY_DIR}/ini/iniPropertyInsert.c
${LIBRARY_DIR}/ini/iniPropertyLast.c
${LIBRARY_DIR}/ini/iniPropertyNext.c
${LIBRARY_DIR}/ini/iniPropertySeek.c
${LIBRARY_DIR}/ini/iniPropertySeekSure.c
${LIBRARY_DIR}/ini/iniPropertyUpdate.c
${LIBRARY_DIR}/ini/iniPropertyValue.c
${LIBRARY_DIR}/ini/iniToUpper.c
${LIBRARY_DIR}/ini/iniValue.c
${LIBRARY_DIR}/log/_logFreeMsg.c
${LIBRARY_DIR}/log/logClear.c
${LIBRARY_DIR}/log/logClose.c
${LIBRARY_DIR}/log/logOn.c
${LIBRARY_DIR}/log/logOpen.c
${LIBRARY_DIR}/log/logPeekMsg.c
${LIBRARY_DIR}/log/logPopMsg.c
${LIBRARY_DIR}/log/logPushMsg.c
${LIBRARY_DIR}/lst/_lstAdjustCurrent.c
${LIBRARY_DIR}/lst/_lstDump.c
${LIBRARY_DIR}/lst/_lstFreeItem.c
${LIBRARY_DIR}/lst/_lstNextValidItem.c
${LIBRARY_DIR}/lst/_lstPrevValidItem.c
${LIBRARY_DIR}/lst/_lstVisible.c
${LIBRARY_DIR}/lst/lstAppend.c
${LIBRARY_DIR}/lst/lstClose.c
${LIBRARY_DIR}/lst/lstDelete.c
${LIBRARY_DIR}/lst/lstEOL.c
${LIBRARY_DIR}/lst/lstFirst.c
${LIBRARY_DIR}/lst/lstGet.c
${LIBRARY_DIR}/lst/lstGetBookMark.c
${LIBRARY_DIR}/lst/lstGoto.c
${LIBRARY_DIR}/lst/lstGotoBookMark.c
${LIBRARY_DIR}/lst/lstInsert.c
${LIBRARY_DIR}/lst/lstLast.c
${LIBRARY_DIR}/lst/lstNext.c
${LIBRARY_DIR}/lst/lstOpen.c
${LIBRARY_DIR}/lst/lstOpenCursor.c
${LIBRARY_DIR}/lst/lstPrev.c
${LIBRARY_DIR}/lst/lstSeek.c
${LIBRARY_DIR}/lst/lstSeekItem.c
${LIBRARY_DIR}/lst/lstSet.c
${LIBRARY_DIR}/lst/lstSetFreeFunc.c
${LIBRARY_DIR}/odbcinst/_logging.c
${LIBRARY_DIR}/odbcinst/_odbcinst_ConfigModeINI.c
${LIBRARY_DIR}/odbcinst/_odbcinst_GetEntries.c
${LIBRARY_DIR}/odbcinst/_odbcinst_GetSections.c
${LIBRARY_DIR}/odbcinst/_odbcinst_SystemINI.c
${LIBRARY_DIR}/odbcinst/_odbcinst_UserINI.c
${LIBRARY_DIR}/odbcinst/_SQLDriverConnectPrompt.c
${LIBRARY_DIR}/odbcinst/_SQLGetInstalledDrivers.c
${LIBRARY_DIR}/odbcinst/_SQLWriteInstalledDrivers.c
${LIBRARY_DIR}/odbcinst/ODBCINSTConstructProperties.c
${LIBRARY_DIR}/odbcinst/ODBCINSTDestructProperties.c
${LIBRARY_DIR}/odbcinst/ODBCINSTSetProperty.c
${LIBRARY_DIR}/odbcinst/ODBCINSTValidateProperties.c
${LIBRARY_DIR}/odbcinst/ODBCINSTValidateProperty.c
${LIBRARY_DIR}/odbcinst/SQLConfigDataSource.c
${LIBRARY_DIR}/odbcinst/SQLConfigDriver.c
${LIBRARY_DIR}/odbcinst/SQLCreateDataSource.c
${LIBRARY_DIR}/odbcinst/SQLGetAvailableDrivers.c
${LIBRARY_DIR}/odbcinst/SQLGetConfigMode.c
${LIBRARY_DIR}/odbcinst/SQLGetInstalledDrivers.c
${LIBRARY_DIR}/odbcinst/SQLGetPrivateProfileString.c
${LIBRARY_DIR}/odbcinst/SQLGetTranslator.c
${LIBRARY_DIR}/odbcinst/SQLInstallDriverEx.c
${LIBRARY_DIR}/odbcinst/SQLInstallDriverManager.c
${LIBRARY_DIR}/odbcinst/SQLInstallerError.c
${LIBRARY_DIR}/odbcinst/SQLInstallODBC.c
${LIBRARY_DIR}/odbcinst/SQLInstallTranslatorEx.c
${LIBRARY_DIR}/odbcinst/SQLManageDataSources.c
${LIBRARY_DIR}/odbcinst/SQLPostInstallerError.c
${LIBRARY_DIR}/odbcinst/SQLReadFileDSN.c
${LIBRARY_DIR}/odbcinst/SQLRemoveDriver.c
${LIBRARY_DIR}/odbcinst/SQLRemoveDriverManager.c
${LIBRARY_DIR}/odbcinst/SQLRemoveDSNFromIni.c
${LIBRARY_DIR}/odbcinst/SQLRemoveTranslator.c
${LIBRARY_DIR}/odbcinst/SQLSetConfigMode.c
${LIBRARY_DIR}/odbcinst/SQLValidDSN.c
${LIBRARY_DIR}/odbcinst/SQLWriteDSNToIni.c
${LIBRARY_DIR}/odbcinst/SQLWriteFileDSN.c
${LIBRARY_DIR}/odbcinst/SQLWritePrivateProfileString.c
)
add_library (unixodbc ${SRCS})
target_link_libraries (unixodbc PRIVATE ltdl)
# SYSTEM_FILE_PATH was changed to /etc
target_include_directories (unixodbc
PRIVATE
linux_x86_64/private
PUBLIC
linux_x86_64
${LIBRARY_DIR}/include
)
target_compile_definitions (unixodbc PRIVATE -DHAVE_CONFIG_H)
target_compile_options (unixodbc
PRIVATE
-Wno-dangling-else
-Wno-parentheses
-Wno-misleading-indentation
-Wno-unknown-warning-option
-Wno-reserved-id-macro
-O2
)
endif () endif ()
target_compile_definitions (unixodbc INTERFACE USE_ODBC=1)
message (STATUS "Using unixodbc")