Revert "cmake: Add option to fail configuration instead of auto-reconfiguration"

This commit is contained in:
alexey-milovidov 2020-08-13 23:10:06 +03:00 committed by GitHub
parent 11d6375c67
commit 89419ceb9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
55 changed files with 1411 additions and 1869 deletions

View File

@ -28,14 +28,6 @@ endforeach()
project(ClickHouse) project(ClickHouse)
option(FAIL_ON_UNSUPPORTED_OPTIONS_COMBINATION
"Stop/Fail CMake configuration if some ENABLE_XXX option is defined (either ON or OFF) but is not possible to satisfy" OFF)
if(FAIL_ON_UNSUPPORTED_OPTIONS_COMBINATION)
set(RECONFIGURE_MESSAGE_LEVEL FATAL_ERROR)
else()
set(RECONFIGURE_MESSAGE_LEVEL STATUS)
endif()
include (cmake/arch.cmake) include (cmake/arch.cmake)
include (cmake/target.cmake) include (cmake/target.cmake)
include (cmake/tools.cmake) include (cmake/tools.cmake)
@ -65,7 +57,7 @@ if(ENABLE_IPO)
message(STATUS "IPO/LTO is supported, enabling") message(STATUS "IPO/LTO is supported, enabling")
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
else() else()
message (${RECONFIGURE_MESSAGE_LEVEL} "IPO/LTO is not supported: <${IPO_NOT_SUPPORTED}>") message(STATUS "IPO/LTO is not supported: <${IPO_NOT_SUPPORTED}>")
endif() endif()
else() else()
message(STATUS "IPO/LTO not enabled.") message(STATUS "IPO/LTO not enabled.")
@ -141,8 +133,6 @@ option (ENABLE_TESTS "Enables tests" ON)
if (OS_LINUX AND NOT UNBUNDLED AND MAKE_STATIC_LIBRARIES AND NOT SPLIT_SHARED_LIBRARIES AND CMAKE_VERSION VERSION_GREATER "3.9.0") if (OS_LINUX AND NOT UNBUNDLED AND MAKE_STATIC_LIBRARIES AND NOT SPLIT_SHARED_LIBRARIES AND CMAKE_VERSION VERSION_GREATER "3.9.0")
option (GLIBC_COMPATIBILITY "Set to TRUE to enable compatibility with older glibc libraries. Only for x86_64, Linux. Implies ENABLE_FASTMEMCPY." ON) option (GLIBC_COMPATIBILITY "Set to TRUE to enable compatibility with older glibc libraries. Only for x86_64, Linux. Implies ENABLE_FASTMEMCPY." ON)
elseif(GLIBC_COMPATIBILITY)
message (${RECONFIGURE_MESSAGE_LEVEL} "Glibc compatibility cannot be enabled in current configuration")
endif () endif ()
if (NOT CMAKE_VERSION VERSION_GREATER "3.9.0") if (NOT CMAKE_VERSION VERSION_GREATER "3.9.0")
@ -266,8 +256,6 @@ if (COMPILER_CLANG)
set (CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -flto=thin") set (CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -flto=thin")
set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -flto=thin") set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -flto=thin")
set (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} -flto=thin") set (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} -flto=thin")
elseif (ENABLE_THINLTO)
message (${RECONFIGURE_MESSAGE_LEVEL} "Cannot enable ThinLTO")
endif () endif ()
# Always prefer llvm tools when using clang. For instance, we cannot use GNU ar when llvm LTO is enabled # Always prefer llvm tools when using clang. For instance, we cannot use GNU ar when llvm LTO is enabled

View File

@ -12,9 +12,7 @@ if (ENABLE_CLANG_TIDY)
set (USE_CLANG_TIDY 1) set (USE_CLANG_TIDY 1)
# The variable CMAKE_CXX_CLANG_TIDY will be set inside src and base directories with non third-party code. # The variable CMAKE_CXX_CLANG_TIDY will be set inside src and base directories with non third-party code.
# set (CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_PATH}") # set (CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_PATH}")
elseif (FAIL_ON_UNSUPPORTED_OPTIONS_COMBINATION)
message(FATAL_ERROR "clang-tidy is not found")
else () else ()
message(STATUS "clang-tidy is not found. This is normal - the tool is only used for static code analysis and isn't essential for the build.") message(STATUS "clang-tidy is not found. This is normal - the tool is used only for static code analysis and not essential for build.")
endif () endif ()
endif () endif ()

View File

@ -8,9 +8,6 @@ macro(find_contrib_lib LIB_NAME)
if (NOT USE_INTERNAL_${LIB_NAME_UC}_LIBRARY) if (NOT USE_INTERNAL_${LIB_NAME_UC}_LIBRARY)
find_package ("${LIB_NAME}") find_package ("${LIB_NAME}")
if (NOT ${LIB_NAME_UC}_FOUND)
message (${RECONFIGURE_MESSAGE_LEVEL} "Cannot use system ${LIB_NAME}")
endif()
endif () endif ()
if (NOT ${LIB_NAME_UC}_FOUND) if (NOT ${LIB_NAME_UC}_FOUND)
@ -20,4 +17,5 @@ macro(find_contrib_lib LIB_NAME)
endif () endif ()
message (STATUS "Using ${LIB_NAME}: ${${LIB_NAME_UC}_INCLUDE_DIR} : ${${LIB_NAME_UC}_LIBRARIES}") message (STATUS "Using ${LIB_NAME}: ${${LIB_NAME_UC}_INCLUDE_DIR} : ${${LIB_NAME_UC}_LIBRARIES}")
endmacro() endmacro()

View File

@ -1,22 +1,21 @@
option(ENABLE_AMQPCPP "Enalbe AMQP-CPP" ${ENABLE_LIBRARIES}) option(ENABLE_AMQPCPP "Enalbe AMQP-CPP" ${ENABLE_LIBRARIES})
if (NOT ENABLE_AMQPCPP)
return()
endif()
if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/AMQP-CPP/CMakeLists.txt") if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/AMQP-CPP/CMakeLists.txt")
message (WARNING "submodule contrib/AMQP-CPP is missing. to fix try run: \n git submodule update --init --recursive") message (WARNING "submodule contrib/AMQP-CPP is missing. to fix try run: \n git submodule update --init --recursive")
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find internal AMQP-CPP library") set (ENABLE_AMQPCPP 0)
set (USE_AMQPCPP 0)
return()
endif () endif ()
if (ENABLE_AMQPCPP)
set (USE_AMQPCPP 1) set (USE_AMQPCPP 1)
set (AMQPCPP_LIBRARY AMQP-CPP) set (AMQPCPP_LIBRARY AMQP-CPP)
set (AMQPCPP_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/AMQP-CPP/include") set (AMQPCPP_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/AMQP-CPP/include")
list (APPEND AMQPCPP_INCLUDE_DIR list (APPEND AMQPCPP_INCLUDE_DIR
"${ClickHouse_SOURCE_DIR}/contrib/AMQP-CPP/include" "${ClickHouse_SOURCE_DIR}/contrib/AMQP-CPP/include"
"${ClickHouse_SOURCE_DIR}/contrib/AMQP-CPP") "${ClickHouse_SOURCE_DIR}/contrib/AMQP-CPP")
endif()
message (STATUS "Using AMQP-CPP=${USE_AMQPCPP}: ${AMQPCPP_INCLUDE_DIR} : ${AMQPCPP_LIBRARY}") message (STATUS "Using AMQP-CPP=${USE_AMQPCPP}: ${AMQPCPP_INCLUDE_DIR} : ${AMQPCPP_LIBRARY}")

View File

@ -1,34 +1,28 @@
option (ENABLE_AVRO "Enable Avro" ${ENABLE_LIBRARIES}) option (ENABLE_AVRO "Enable Avro" ${ENABLE_LIBRARIES})
if (NOT ENABLE_AVRO) if (ENABLE_AVRO)
if (USE_INTERNAL_AVRO_LIBRARY)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't use internal avro library with ENABLE_AVRO=OFF")
endif()
return()
endif()
option (USE_INTERNAL_AVRO_LIBRARY "Set to FALSE to use system avro library instead of bundled" ${NOT_UNBUNDLED}) option (USE_INTERNAL_AVRO_LIBRARY "Set to FALSE to use system avro library instead of bundled" ${NOT_UNBUNDLED})
if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/avro/lang/c++/CMakeLists.txt") if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/avro/lang/c++/CMakeLists.txt")
if(USE_INTERNAL_AVRO_LIBRARY) if(USE_INTERNAL_AVRO_LIBRARY)
message(WARNING "submodule contrib/avro is missing. to fix try run: \n git submodule update --init --recursive") message(WARNING "submodule contrib/avro is missing. to fix try run: \n git submodule update --init --recursive")
message (${RECONFIGURE_MESSAGE_LEVEL} "Cannot find internal avro")
set(USE_INTERNAL_AVRO_LIBRARY 0)
endif() endif()
set(MISSING_INTERNAL_AVRO_LIBRARY 1) set(MISSING_INTERNAL_AVRO_LIBRARY 1)
set(USE_INTERNAL_AVRO_LIBRARY 0)
endif() endif()
if (NOT USE_INTERNAL_AVRO_LIBRARY) if (NOT USE_INTERNAL_AVRO_LIBRARY)
message (${RECONFIGURE_MESSAGE_LEVEL} "Using system avro library is not supported yet")
elseif(NOT MISSING_INTERNAL_AVRO_LIBRARY) elseif(NOT MISSING_INTERNAL_AVRO_LIBRARY)
include(cmake/find/snappy.cmake) include(cmake/find/snappy.cmake)
set(AVROCPP_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/avro/lang/c++/include") set(AVROCPP_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/avro/lang/c++/include")
set(AVROCPP_LIBRARY avrocpp) set(AVROCPP_LIBRARY avrocpp)
set(USE_INTERNAL_AVRO_LIBRARY 1)
endif () endif ()
if (AVROCPP_LIBRARY AND AVROCPP_INCLUDE_DIR) if (AVROCPP_LIBRARY AND AVROCPP_INCLUDE_DIR)
set(USE_AVRO 1) set(USE_AVRO 1)
endif() endif()
endif()
message (STATUS "Using avro=${USE_AVRO}: ${AVROCPP_INCLUDE_DIR} : ${AVROCPP_LIBRARY}") message (STATUS "Using avro=${USE_AVRO}: ${AVROCPP_INCLUDE_DIR} : ${AVROCPP_LIBRARY}")

View File

@ -1,21 +1,17 @@
option (ENABLE_BASE64 "Enable base64" ${ENABLE_LIBRARIES})
if (NOT ENABLE_BASE64)
return()
endif()
if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/base64/LICENSE") if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/base64/LICENSE")
set (MISSING_INTERNAL_BASE64_LIBRARY 1) set (MISSING_INTERNAL_BASE64_LIBRARY 1)
message (WARNING "submodule contrib/base64 is missing. to fix try run: \n git submodule update --init --recursive") message (WARNING "submodule contrib/base64 is missing. to fix try run: \n git submodule update --init --recursive")
endif () endif ()
if (NOT MISSING_INTERNAL_BASE64_LIBRARY)
option (ENABLE_BASE64 "Enable base64" ${ENABLE_LIBRARIES})
endif ()
if (ENABLE_BASE64)
if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/base64") if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/base64")
message (WARNING "submodule contrib/base64 is missing. to fix try run: \n git submodule update --init --recursive") message (WARNING "submodule contrib/base64 is missing. to fix try run: \n git submodule update --init --recursive")
else() else()
set (BASE64_LIBRARY base64) set (BASE64_LIBRARY base64)
set (USE_BASE64 1) set (USE_BASE64 1)
endif() endif()
if (NOT USE_BASE64)
message (${RECONFIGURE_MESSAGE_LEVEL} "Cannot enable base64")
endif () endif ()

View File

@ -1,18 +1,12 @@
option (ENABLE_BROTLI "Enable brotli" ${ENABLE_LIBRARIES}) option (ENABLE_BROTLI "Enable brotli" ${ENABLE_LIBRARIES})
if (NOT ENABLE_BROTLI) if (ENABLE_BROTLI)
if (USE_INTERNAL_BROTLI_LIBRARY)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't use internal brotly library with ENABLE_BROTLI=OFF")
endif()
return()
endif()
option (USE_INTERNAL_BROTLI_LIBRARY "Set to FALSE to use system libbrotli library instead of bundled" ${NOT_UNBUNDLED}) option (USE_INTERNAL_BROTLI_LIBRARY "Set to FALSE to use system libbrotli library instead of bundled" ${NOT_UNBUNDLED})
if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/brotli/c/include/brotli/decode.h") if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/brotli/c/include/brotli/decode.h")
if (USE_INTERNAL_BROTLI_LIBRARY) if (USE_INTERNAL_BROTLI_LIBRARY)
message (WARNING "submodule contrib/brotli is missing. to fix try run: \n git submodule update --init --recursive") message (WARNING "submodule contrib/brotli is missing. to fix try run: \n git submodule update --init --recursive")
message (${RECONFIGURE_MESSAGE_LEVEL} "Cannot find internal brotli")
set (USE_INTERNAL_BROTLI_LIBRARY 0) set (USE_INTERNAL_BROTLI_LIBRARY 0)
endif () endif ()
set (MISSING_INTERNAL_BROTLI_LIBRARY 1) set (MISSING_INTERNAL_BROTLI_LIBRARY 1)
@ -25,18 +19,18 @@ if(NOT USE_INTERNAL_BROTLI_LIBRARY)
find_path(BROTLI_INCLUDE_DIR NAMES brotli/decode.h brotli/encode.h brotli/port.h brotli/types.h PATHS ${BROTLI_INCLUDE_PATHS}) find_path(BROTLI_INCLUDE_DIR NAMES brotli/decode.h brotli/encode.h brotli/port.h brotli/types.h PATHS ${BROTLI_INCLUDE_PATHS})
if(BROTLI_LIBRARY_DEC AND BROTLI_LIBRARY_ENC AND BROTLI_LIBRARY_COMMON) if(BROTLI_LIBRARY_DEC AND BROTLI_LIBRARY_ENC AND BROTLI_LIBRARY_COMMON)
set(BROTLI_LIBRARY ${BROTLI_LIBRARY_DEC} ${BROTLI_LIBRARY_ENC} ${BROTLI_LIBRARY_COMMON}) set(BROTLI_LIBRARY ${BROTLI_LIBRARY_DEC} ${BROTLI_LIBRARY_ENC} ${BROTLI_LIBRARY_COMMON})
else()
message (${RECONFIGURE_MESSAGE_LEVEL} "Cannot use system brotli")
endif() endif()
endif() endif()
if (BROTLI_LIBRARY AND BROTLI_INCLUDE_DIR) if (BROTLI_LIBRARY AND BROTLI_INCLUDE_DIR)
set (USE_BROTLI 1) set (USE_BROTLI 1)
elseif (NOT MISSING_INTERNAL_BROTLI_LIBRARY) elseif (NOT MISSING_INTERNAL_BROTLI_LIBRARY)
set (BROTLI_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/brotli/c/include") set (BROTLI_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/contrib/brotli/c/include)
set (USE_INTERNAL_BROTLI_LIBRARY 1) set (USE_INTERNAL_BROTLI_LIBRARY 1)
set (BROTLI_LIBRARY brotli) set (BROTLI_LIBRARY brotli)
set (USE_BROTLI 1) set (USE_BROTLI 1)
endif () endif ()
endif()
message (STATUS "Using brotli=${USE_BROTLI}: ${BROTLI_INCLUDE_DIR} : ${BROTLI_LIBRARY}") message (STATUS "Using brotli=${USE_BROTLI}: ${BROTLI_INCLUDE_DIR} : ${BROTLI_LIBRARY}")

View File

@ -1,21 +1,15 @@
option (ENABLE_CAPNP "Enable Cap'n Proto" ${ENABLE_LIBRARIES}) option (ENABLE_CAPNP "Enable Cap'n Proto" ${ENABLE_LIBRARIES})
if (NOT ENABLE_CAPNP) if (ENABLE_CAPNP)
if (USE_INTERNAL_CAPNP_LIBRARY)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't use internal capnproto library with ENABLE_CAPNP=OFF")
endif()
return()
endif()
option (USE_INTERNAL_CAPNP_LIBRARY "Set to FALSE to use system capnproto library instead of bundled" ${NOT_UNBUNDLED}) option (USE_INTERNAL_CAPNP_LIBRARY "Set to FALSE to use system capnproto library instead of bundled" ${NOT_UNBUNDLED})
if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/capnproto/CMakeLists.txt") if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/capnproto/CMakeLists.txt")
if(USE_INTERNAL_CAPNP_LIBRARY) if(USE_INTERNAL_CAPNP_LIBRARY)
message(WARNING "submodule contrib/capnproto is missing. to fix try run: \n git submodule update --init --recursive") message(WARNING "submodule contrib/capnproto is missing. to fix try run: \n git submodule update --init --recursive")
message(${RECONFIGURE_MESSAGE_LEVEL} "cannot find internal capnproto")
set(USE_INTERNAL_CAPNP_LIBRARY 0)
endif() endif()
set(MISSING_INTERNAL_CAPNP_LIBRARY 1) set(MISSING_INTERNAL_CAPNP_LIBRARY 1)
set(USE_INTERNAL_CAPNP_LIBRARY 0)
endif() endif()
# FIXME: refactor to use `add_library( IMPORTED)` if possible. # FIXME: refactor to use `add_library( IMPORTED)` if possible.
@ -24,21 +18,17 @@ if (NOT USE_INTERNAL_CAPNP_LIBRARY)
find_library (CAPNP capnp) find_library (CAPNP capnp)
find_library (CAPNPC capnpc) find_library (CAPNPC capnpc)
if(KJ AND CAPNP AND CAPNPC)
set (CAPNP_LIBRARIES ${CAPNPC} ${CAPNP} ${KJ}) set (CAPNP_LIBRARIES ${CAPNPC} ${CAPNP} ${KJ})
else()
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find system capnproto")
endif()
endif()
if (CAPNP_LIBRARIES)
set (USE_CAPNP 1)
elseif(NOT MISSING_INTERNAL_CAPNP_LIBRARY) elseif(NOT MISSING_INTERNAL_CAPNP_LIBRARY)
add_subdirectory(contrib/capnproto-cmake) add_subdirectory(contrib/capnproto-cmake)
set (CAPNP_LIBRARIES capnpc) set (CAPNP_LIBRARIES capnpc)
endif ()
if (CAPNP_LIBRARIES)
set (USE_CAPNP 1) set (USE_CAPNP 1)
set (USE_INTERNAL_CAPNP_LIBRARY 1) endif ()
endif () endif ()
message (STATUS "Using capnp=${USE_CAPNP}: ${CAPNP_LIBRARIES}") message (STATUS "Using capnp=${USE_CAPNP}: ${CAPNP_LIBRARIES}")

View File

@ -1,29 +1,25 @@
option(ENABLE_CASSANDRA "Enable Cassandra" ${ENABLE_LIBRARIES}) option(ENABLE_CASSANDRA "Enable Cassandra" ${ENABLE_LIBRARIES})
if (NOT ENABLE_CASSANDRA) if (ENABLE_CASSANDRA)
return()
endif()
if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/libuv") if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/libuv")
message (ERROR "submodule contrib/libuv is missing. to fix try run: \n git submodule update --init --recursive") message (ERROR "submodule contrib/libuv is missing. to fix try run: \n git submodule update --init --recursive")
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find internal libuv needed for Cassandra")
elseif (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/cassandra") elseif (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/cassandra")
message (ERROR "submodule contrib/cassandra is missing. to fix try run: \n git submodule update --init --recursive") message (ERROR "submodule contrib/cassandra is missing. to fix try run: \n git submodule update --init --recursive")
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find internal Cassandra")
else() else()
set (LIBUV_ROOT_DIR "${ClickHouse_SOURCE_DIR}/contrib/libuv") set (LIBUV_ROOT_DIR "${ClickHouse_SOURCE_DIR}/contrib/libuv")
set (CASSANDRA_INCLUDE_DIR set (CASSANDRA_INCLUDE_DIR
"${ClickHouse_SOURCE_DIR}/contrib/cassandra/include/") "${ClickHouse_SOURCE_DIR}/contrib/cassandra/include/")
if (MAKE_STATIC_LIBRARIES) if (USE_STATIC_LIBRARIES)
set (LIBUV_LIBRARY uv_a) set (LIBUV_LIBRARY uv_a)
set (CASSANDRA_LIBRARY cassandra_static) set (CASSANDRA_LIBRARY cassandra_static)
else() else()
set (LIBUV_LIBRARY uv) set (LIBUV_LIBRARY uv)
set (CASSANDRA_LIBRARY cassandra) set (CASSANDRA_LIBRARY cassandra)
endif() endif()
set (USE_CASSANDRA 1) set (USE_CASSANDRA 1)
set (CASS_ROOT_DIR "${ClickHouse_SOURCE_DIR}/contrib/cassandra") set (CASS_ROOT_DIR "${ClickHouse_SOURCE_DIR}/contrib/cassandra")
endif()
endif() endif()
message (STATUS "Using cassandra=${USE_CASSANDRA}: ${CASSANDRA_INCLUDE_DIR} : ${CASSANDRA_LIBRARY}") message (STATUS "Using cassandra=${USE_CASSANDRA}: ${CASSANDRA_INCLUDE_DIR} : ${CASSANDRA_LIBRARY}")

View File

@ -1,9 +1,3 @@
option(ENABLE_CCACHE "Speedup re-compilations using ccache" ON)
if (NOT ENABLE_CCACHE)
return()
endif()
find_program (CCACHE_FOUND ccache) find_program (CCACHE_FOUND ccache)
if (CCACHE_FOUND AND NOT CMAKE_CXX_COMPILER_LAUNCHER MATCHES "ccache" AND NOT CMAKE_CXX_COMPILER MATCHES "ccache") if (CCACHE_FOUND AND NOT CMAKE_CXX_COMPILER_LAUNCHER MATCHES "ccache" AND NOT CMAKE_CXX_COMPILER MATCHES "ccache")
@ -15,8 +9,6 @@ if (CCACHE_FOUND AND NOT CMAKE_CXX_COMPILER_LAUNCHER MATCHES "ccache" AND NOT CM
set_property (GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${CCACHE_FOUND}) set_property (GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${CCACHE_FOUND})
set_property (GLOBAL PROPERTY RULE_LAUNCH_LINK ${CCACHE_FOUND}) set_property (GLOBAL PROPERTY RULE_LAUNCH_LINK ${CCACHE_FOUND})
else () else ()
message(${RECONFIGURE_MESSAGE_LEVEL} "Not using ${CCACHE_FOUND} ${CCACHE_VERSION} bug: https://bugzilla.samba.org/show_bug.cgi?id=8118") message(STATUS "Not using ${CCACHE_FOUND} ${CCACHE_VERSION} bug: https://bugzilla.samba.org/show_bug.cgi?id=8118")
endif () endif ()
elseif (NOT CCACHE_FOUND)
message (${RECONFIGURE_MESSAGE_LEVEL} "Cannot use ccache")
endif () endif ()

View File

@ -1,27 +1,14 @@
option (USE_LIBCXX "Use libc++ and libc++abi instead of libstdc++" ${NOT_UNBUNDLED})
if (NOT USE_LIBCXX)
if (USE_INTERNAL_LIBCXX_LIBRARY)
message (${RECONFIGURE_MESSAGE_LEVEL} "Cannot use internal libcxx with USE_LIBCXX=OFF")
endif()
target_link_libraries(global-libs INTERFACE -l:libstdc++.a -l:libstdc++fs.a) # Always link these libraries as static
target_link_libraries(global-libs INTERFACE ${EXCEPTION_HANDLING_LIBRARY})
return()
endif()
set(USE_INTERNAL_LIBCXX_LIBRARY_DEFAULT ${NOT_UNBUNDLED}) set(USE_INTERNAL_LIBCXX_LIBRARY_DEFAULT ${NOT_UNBUNDLED})
option (USE_INTERNAL_LIBCXX_LIBRARY "Set to FALSE to use system libcxx and libcxxabi libraries instead of bundled" ${USE_INTERNAL_LIBCXX_LIBRARY_DEFAULT})
if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/libcxx/CMakeLists.txt") if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/libcxx/CMakeLists.txt")
if (USE_INTERNAL_LIBCXX_LIBRARY)
message(WARNING "submodule contrib/libcxx is missing. to fix try run: \n git submodule update --init --recursive") message(WARNING "submodule contrib/libcxx is missing. to fix try run: \n git submodule update --init --recursive")
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find internal libcxx")
set(USE_INTERNAL_LIBCXX_LIBRARY 0)
endif()
set(USE_INTERNAL_LIBCXX_LIBRARY_DEFAULT 0) set(USE_INTERNAL_LIBCXX_LIBRARY_DEFAULT 0)
set(MISSING_INTERNAL_LIBCXX_LIBRARY 1)
endif() endif()
option (USE_LIBCXX "Use libc++ and libc++abi instead of libstdc++" ${NOT_UNBUNDLED})
option (USE_INTERNAL_LIBCXX_LIBRARY "Set to FALSE to use system libcxx and libcxxabi libraries instead of bundled" ${USE_INTERNAL_LIBCXX_LIBRARY_DEFAULT})
if (USE_LIBCXX)
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_LIBCPP_DEBUG=0") # More checks in debug build. set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_LIBCPP_DEBUG=0") # More checks in debug build.
if (NOT USE_INTERNAL_LIBCXX_LIBRARY) if (NOT USE_INTERNAL_LIBCXX_LIBRARY)
@ -29,36 +16,22 @@ if (NOT USE_INTERNAL_LIBCXX_LIBRARY)
find_library (LIBCXXFS_LIBRARY c++fs) find_library (LIBCXXFS_LIBRARY c++fs)
find_library (LIBCXXABI_LIBRARY c++abi) find_library (LIBCXXABI_LIBRARY c++abi)
if(LIBCXX_LIBRARY AND LIBCXXABI_LIBRARY) # c++fs is now a part of the libc++
set (HAVE_LIBCXX 1)
else ()
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find system libcxx")
endif()
if(NOT LIBCXXFS_LIBRARY)
set(LIBCXXFS_LIBRARY ${LIBCXX_LIBRARY})
endif()
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
target_link_libraries(global-libs INTERFACE ${EXCEPTION_HANDLING_LIBRARY}) target_link_libraries(global-libs INTERFACE ${EXCEPTION_HANDLING_LIBRARY})
endif () else ()
if (NOT HAVE_LIBCXX AND NOT MISSING_INTERNAL_LIBCXX_LIBRARY)
set (LIBCXX_LIBRARY cxx) set (LIBCXX_LIBRARY cxx)
set (LIBCXXABI_LIBRARY cxxabi) set (LIBCXXABI_LIBRARY cxxabi)
add_subdirectory(contrib/libcxxabi-cmake) add_subdirectory(contrib/libcxxabi-cmake)
add_subdirectory(contrib/libcxx-cmake) add_subdirectory(contrib/libcxx-cmake)
# Exception handling library is embedded into libcxxabi. # Exception handling library is embedded into libcxxabi.
set (HAVE_LIBCXX 1)
set(USE_INTERNAL_LIBCXX_LIBRARY 1)
endif () endif ()
if (HAVE_LIBCXX)
target_link_libraries(global-libs INTERFACE ${LIBCXX_LIBRARY} ${LIBCXXABI_LIBRARY} ${LIBCXXFS_LIBRARY}) target_link_libraries(global-libs INTERFACE ${LIBCXX_LIBRARY} ${LIBCXXABI_LIBRARY} ${LIBCXXFS_LIBRARY})
set (HAVE_LIBCXX 1)
message (STATUS "Using libcxx: ${LIBCXX_LIBRARY}") message (STATUS "Using libcxx: ${LIBCXX_LIBRARY}")
message (STATUS "Using libcxxfs: ${LIBCXXFS_LIBRARY}") message (STATUS "Using libcxxfs: ${LIBCXXFS_LIBRARY}")
message (STATUS "Using libcxxabi: ${LIBCXXABI_LIBRARY}") message (STATUS "Using libcxxabi: ${LIBCXXABI_LIBRARY}")

View File

@ -1,24 +1,19 @@
if(NOT ARCH_ARM AND NOT OS_FREEBSD AND NOT OS_DARWIN) if(NOT ARCH_ARM AND NOT OS_FREEBSD AND NOT OS_DARWIN)
option(ENABLE_FASTOPS "Enable fast vectorized mathematical functions library by Mikhail Parakhin" ${ENABLE_LIBRARIES}) option(ENABLE_FASTOPS "Enable fast vectorized mathematical functions library by Mikhail Parakhin" ${ENABLE_LIBRARIES})
elseif(ENABLE_FASTOPS)
message (${RECONFIGURE_MESSAGE_LEVEL} "Fastops library is not supported on ARM, FreeBSD and Darwin")
endif()
if(NOT ENABLE_FASTOPS)
set(USE_FASTOPS 0)
return()
endif() endif()
if(ENABLE_FASTOPS)
if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/fastops/fastops/fastops.h") if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/fastops/fastops/fastops.h")
message(WARNING "submodule contrib/fastops is missing. to fix try run: \n git submodule update --init --recursive") message(WARNING "submodule contrib/fastops is missing. to fix try run: \n git submodule update --init --recursive")
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find internal fastops library")
set(MISSING_INTERNAL_FASTOPS_LIBRARY 1) set(MISSING_INTERNAL_FASTOPS_LIBRARY 1)
endif() endif()
if(NOT MISSING_INTERNAL_FASTOPS_LIBRARY) if(NOT MISSING_INTERNAL_FASTOPS_LIBRARY)
set(USE_FASTOPS 1) set(USE_FASTOPS 1)
set(FASTOPS_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/contrib/fastops/) set(FASTOPS_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/contrib/fastops/)
set(FASTOPS_LIBRARY fastops) set(FASTOPS_LIBRARY fastops)
endif() endif()
else()
set(USE_FASTOPS 0)
endif()
message(STATUS "Using fastops=${USE_FASTOPS}: ${FASTOPS_INCLUDE_DIR} : ${FASTOPS_LIBRARY}") message(STATUS "Using fastops=${USE_FASTOPS}: ${FASTOPS_INCLUDE_DIR} : ${FASTOPS_LIBRARY}")

View File

@ -1,11 +1,8 @@
if(NOT DEFINED ENABLE_GPERF OR ENABLE_GPERF)
# Check if gperf was installed # Check if gperf was installed
find_program(GPERF gperf) find_program(GPERF gperf)
if(GPERF) if(GPERF)
option(ENABLE_GPERF "Use gperf function hash generator tool" ${ENABLE_LIBRARIES}) option(ENABLE_GPERF "Use gperf function hash generator tool" ${ENABLE_LIBRARIES})
endif() endif()
endif()
if (ENABLE_GPERF) if (ENABLE_GPERF)
if(NOT GPERF) if(NOT GPERF)
message(FATAL_ERROR "Could not find the program gperf") message(FATAL_ERROR "Could not find the program gperf")

View File

@ -1,37 +1,25 @@
option (ENABLE_GRPC "Use gRPC" ${ENABLE_LIBRARIES}) option (ENABLE_GRPC "Use gRPC" ${ENABLE_LIBRARIES})
if (NOT ENABLE_GRPC) if (ENABLE_GRPC)
if (USE_INTERNAL_GRPC_LIBRARY)
message (${RECONFIGURE_MESSAGE_LEVEL} "Cannot use internal gRPC library with ENABLE_GRPC=OFF")
endif()
return()
endif()
option (USE_INTERNAL_GRPC_LIBRARY "Set to FALSE to use system gRPC library instead of bundled" ${NOT_UNBUNDLED}) option (USE_INTERNAL_GRPC_LIBRARY "Set to FALSE to use system gRPC library instead of bundled" ${NOT_UNBUNDLED})
if (NOT USE_INTERNAL_GRPC_LIBRARY) if (USE_INTERNAL_GRPC_LIBRARY)
find_package(grpc)
if (GRPC_INCLUDE_DIR AND GRPC_LIBRARY)
set (USE_GRPC ON)
else()
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find system gRPC")
endif()
endif()
if (NOT USE_GRPC)
if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/grpc/include/grpc++/grpc++.h") if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/grpc/include/grpc++/grpc++.h")
message(WARNING "submodule contrib/grpc is missing. To fix try run: \n git submodule update --init --recursive") message(WARNING "submodule contrib/grpc is missing. To fix try run: \n git submodule update --init --recursive")
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find internal gRPC")
set (USE_INTERNAL_GRPC_LIBRARY OFF) set (USE_INTERNAL_GRPC_LIBRARY OFF)
elseif (NOT USE_PROTOBUF) elif (NOT USE_PROTOBUF)
message(WARNING "gRPC requires protobuf which is disabled") message(WARNING "gRPC requires protobuf which is disabled")
message (${RECONFIGURE_MESSAGE_LEVEL} "Will not use internal gRPC without protobuf")
set (USE_INTERNAL_GRPC_LIBRARY OFF) set (USE_INTERNAL_GRPC_LIBRARY OFF)
else() else()
set (GRPC_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/grpc/include") set (GRPC_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/grpc/include")
set (GRPC_LIBRARY "libgrpc++") set (GRPC_LIBRARY "libgrpc++")
set (USE_GRPC ON) set (USE_GRPC ON)
set (USE_INTERNAL_GRPC_LIBRARY ON) endif()
else()
find_package(grpc)
if (GRPC_INCLUDE_DIR AND GRPC_LIBRARY)
set (USE_GRPC ON)
endif()
endif() endif()
endif() endif()

View File

@ -1,30 +1,22 @@
option (ENABLE_GTEST_LIBRARY "Enable gtest library" ${ENABLE_LIBRARIES}) option (ENABLE_GTEST_LIBRARY "Enable gtest library" ${ENABLE_LIBRARIES})
if (NOT ENABLE_GTEST_LIBRARY) if (ENABLE_GTEST_LIBRARY)
if(USE_INTERNAL_GTEST_LIBRARY)
message (${RECONFIGURE_MESSAGE_LEVEL} "Cannot use internal Google Test when ENABLE_GTEST_LIBRARY=OFF")
endif()
return()
endif()
option (USE_INTERNAL_GTEST_LIBRARY "Set to FALSE to use system Google Test instead of bundled" ${NOT_UNBUNDLED}) option (USE_INTERNAL_GTEST_LIBRARY "Set to FALSE to use system Google Test instead of bundled" ${NOT_UNBUNDLED})
if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/googletest/googletest/CMakeLists.txt") if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/googletest/googletest/CMakeLists.txt")
if (USE_INTERNAL_GTEST_LIBRARY) if (USE_INTERNAL_GTEST_LIBRARY)
message (WARNING "submodule contrib/googletest is missing. to fix try run: \n git submodule update --init --recursive") message (WARNING "submodule contrib/googletest is missing. to fix try run: \n git submodule update --init --recursive")
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find internal gtest")
set (USE_INTERNAL_GTEST_LIBRARY 0) set (USE_INTERNAL_GTEST_LIBRARY 0)
endif () endif ()
set (MISSING_INTERNAL_GTEST_LIBRARY 1) set (MISSING_INTERNAL_GTEST_LIBRARY 1)
endif () endif ()
if(NOT USE_INTERNAL_GTEST_LIBRARY) if(NOT USE_INTERNAL_GTEST_LIBRARY)
# TODO: autodetect of GTEST_SRC_DIR by EXISTS /usr/src/googletest/CMakeLists.txt # TODO: autodetect of GTEST_SRC_DIR by EXISTS /usr/src/googletest/CMakeLists.txt
if(NOT GTEST_SRC_DIR) if(NOT GTEST_SRC_DIR)
find_package(GTest) find_package(GTest)
if (NOT GTEST_INCLUDE_DIRS)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find system Google Test")
endif()
endif() endif()
endif() endif()
@ -34,13 +26,12 @@ if (NOT GTEST_SRC_DIR AND NOT GTEST_INCLUDE_DIRS AND NOT MISSING_INTERNAL_GTEST_
set (GTEST_LIBRARIES gtest) set (GTEST_LIBRARIES gtest)
set (GTEST_BOTH_LIBRARIES ${GTEST_MAIN_LIBRARIES} ${GTEST_LIBRARIES}) set (GTEST_BOTH_LIBRARIES ${GTEST_MAIN_LIBRARIES} ${GTEST_LIBRARIES})
set (GTEST_INCLUDE_DIRS ${ClickHouse_SOURCE_DIR}/contrib/googletest/googletest) set (GTEST_INCLUDE_DIRS ${ClickHouse_SOURCE_DIR}/contrib/googletest/googletest)
elseif(USE_INTERNAL_GTEST_LIBRARY)
message (${RECONFIGURE_MESSAGE_LEVEL} "Wouldn't use internal Google Test library")
set (USE_INTERNAL_GTEST_LIBRARY 0)
endif () endif ()
if((GTEST_INCLUDE_DIRS AND GTEST_BOTH_LIBRARIES) OR GTEST_SRC_DIR) if((GTEST_INCLUDE_DIRS AND GTEST_BOTH_LIBRARIES) OR GTEST_SRC_DIR)
set(USE_GTEST 1) set(USE_GTEST 1)
endif() endif()
endif()
message (STATUS "Using gtest=${USE_GTEST}: ${GTEST_INCLUDE_DIRS} : ${GTEST_BOTH_LIBRARIES} : ${GTEST_SRC_DIR}") message (STATUS "Using gtest=${USE_GTEST}: ${GTEST_INCLUDE_DIRS} : ${GTEST_BOTH_LIBRARIES} : ${GTEST_SRC_DIR}")

View File

@ -1,38 +1,28 @@
option (ENABLE_H3 "Enable H3" ${ENABLE_LIBRARIES}) option (ENABLE_H3 "Enable H3" ${ENABLE_LIBRARIES})
if(NOT ENABLE_H3) if (ENABLE_H3)
if(USE_INTERNAL_H3_LIBRARY)
message (${RECONFIGURE_MESSAGE_LEVEL} "Cannot use internal h3 library with ENABLE_H3=OFF")
endif ()
return()
endif()
option (USE_INTERNAL_H3_LIBRARY "Set to FALSE to use system h3 library instead of bundled" ${NOT_UNBUNDLED}) option (USE_INTERNAL_H3_LIBRARY "Set to FALSE to use system h3 library instead of bundled" ${NOT_UNBUNDLED})
if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/h3/src/h3lib/include/h3Index.h") if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/h3/src/h3lib/include/h3Index.h")
if(USE_INTERNAL_H3_LIBRARY) if(USE_INTERNAL_H3_LIBRARY)
message(WARNING "submodule contrib/h3 is missing. to fix try run: \n git submodule update --init --recursive") message(WARNING "submodule contrib/h3 is missing. to fix try run: \n git submodule update --init --recursive")
message(${RECONFIGURE_MESSAGE_LEVEL} "Can't find internal h3 library")
set(USE_INTERNAL_H3_LIBRARY 0)
endif() endif()
set(MISSING_INTERNAL_H3_LIBRARY 1) set(MISSING_INTERNAL_H3_LIBRARY 1)
set(USE_INTERNAL_H3_LIBRARY 0)
endif() endif()
if(NOT USE_INTERNAL_H3_LIBRARY) if (USE_INTERNAL_H3_LIBRARY)
set (H3_LIBRARY h3)
set (H3_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/contrib/h3/src/h3lib/include)
elseif (NOT MISSING_INTERNAL_H3_LIBRARY)
find_library (H3_LIBRARY h3) find_library (H3_LIBRARY h3)
find_path (H3_INCLUDE_DIR NAMES h3/h3api.h PATHS ${H3_INCLUDE_PATHS}) find_path (H3_INCLUDE_DIR NAMES h3/h3api.h PATHS ${H3_INCLUDE_PATHS})
if(NOT H3_LIBRARY OR NOT H3_INCLUDE_DIR)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find system h3 library")
endif()
endif () endif ()
if (H3_LIBRARY AND H3_INCLUDE_DIR) if (H3_LIBRARY AND H3_INCLUDE_DIR)
set (USE_H3 1) set (USE_H3 1)
elseif(NOT MISSING_INTERNAL_H3_LIBRARY) endif ()
set (H3_LIBRARY h3)
set (H3_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/h3/src/h3lib/include")
set (USE_H3 1)
set (USE_INTERNAL_H3_LIBRARY 1)
endif () endif ()
message (STATUS "Using h3=${USE_H3}: ${H3_INCLUDE_DIR} : ${H3_LIBRARY}") message (STATUS "Using h3=${USE_H3}: ${H3_INCLUDE_DIR} : ${H3_LIBRARY}")

View File

@ -1,33 +1,21 @@
if(NOT ARCH_ARM AND NOT OS_FREEBSD AND NOT APPLE AND USE_PROTOBUF) if(NOT ARCH_ARM AND NOT OS_FREEBSD AND NOT APPLE AND USE_PROTOBUF)
option(ENABLE_HDFS "Enable HDFS" ${ENABLE_LIBRARIES}) option(ENABLE_HDFS "Enable HDFS" ${ENABLE_LIBRARIES})
elseif(ENABLE_HDFS OR USE_INTERNAL_HDFS3_LIBRARY)
message (${RECONFIGURE_MESSAGE_LEVEL} "Cannot use HDFS3 with current configuration")
endif()
if(NOT ENABLE_HDFS)
if(USE_INTERNAL_HDFS3_LIBRARY)
message (${RECONFIGURE_MESSAGE_LEVEL} "Cannot use internal HDFS3 library with ENABLE_HDFS3=OFF")
endif()
return()
endif() endif()
if(ENABLE_HDFS)
option(USE_INTERNAL_HDFS3_LIBRARY "Set to FALSE to use system HDFS3 instead of bundled" ${NOT_UNBUNDLED}) option(USE_INTERNAL_HDFS3_LIBRARY "Set to FALSE to use system HDFS3 instead of bundled" ${NOT_UNBUNDLED})
if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/libhdfs3/include/hdfs/hdfs.h") if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/libhdfs3/include/hdfs/hdfs.h")
if(USE_INTERNAL_HDFS3_LIBRARY) if(USE_INTERNAL_HDFS3_LIBRARY)
message(WARNING "submodule contrib/libhdfs3 is missing. to fix try run: \n git submodule update --init --recursive") message(WARNING "submodule contrib/libhdfs3 is missing. to fix try run: \n git submodule update --init --recursive")
message (${RECONFIGURE_MESSAGE_LEVEL} "Cannot use internal HDFS3 library")
set(USE_INTERNAL_HDFS3_LIBRARY 0)
endif() endif()
set(MISSING_INTERNAL_HDFS3_LIBRARY 1) set(MISSING_INTERNAL_HDFS3_LIBRARY 1)
set(USE_INTERNAL_HDFS3_LIBRARY 0)
endif() endif()
if(NOT USE_INTERNAL_HDFS3_LIBRARY) if(NOT USE_INTERNAL_HDFS3_LIBRARY)
find_library(HDFS3_LIBRARY hdfs3) find_library(HDFS3_LIBRARY hdfs3)
find_path(HDFS3_INCLUDE_DIR NAMES hdfs/hdfs.h PATHS ${HDFS3_INCLUDE_PATHS}) find_path(HDFS3_INCLUDE_DIR NAMES hdfs/hdfs.h PATHS ${HDFS3_INCLUDE_PATHS})
if(NOT HDFS3_LIBRARY OR NOT HDFS3_INCLUDE_DIR)
message (${RECONFIGURE_MESSAGE_LEVEL} "Cannot find system HDFS3 library")
endif()
endif() endif()
if(HDFS3_LIBRARY AND HDFS3_INCLUDE_DIR) if(HDFS3_LIBRARY AND HDFS3_INCLUDE_DIR)
@ -38,7 +26,9 @@ elseif(NOT MISSING_INTERNAL_HDFS3_LIBRARY AND LIBGSASL_LIBRARY AND LIBXML2_LIBRA
set(USE_INTERNAL_HDFS3_LIBRARY 1) set(USE_INTERNAL_HDFS3_LIBRARY 1)
set(USE_HDFS 1) set(USE_HDFS 1)
else() else()
message (${RECONFIGURE_MESSAGE_LEVEL} "Cannout enable HDFS3") set(USE_INTERNAL_HDFS3_LIBRARY 0)
endif()
endif() endif()
message(STATUS "Using hdfs3=${USE_HDFS}: ${HDFS3_INCLUDE_DIR} : ${HDFS3_LIBRARY}") message(STATUS "Using hdfs3=${USE_HDFS}: ${HDFS3_INCLUDE_DIR} : ${HDFS3_LIBRARY}")

View File

@ -4,20 +4,13 @@ else ()
option(ENABLE_ICU "Enable ICU" 0) option(ENABLE_ICU "Enable ICU" 0)
endif () endif ()
if (NOT ENABLE_ICU) if (ENABLE_ICU)
if(USE_INTERNAL_ICU_LIBRARY)
message (${RECONFIGURE_MESSAGE_LEVEL} "Cannot use internal icu library with ENABLE_ICU=OFF")
endif()
message(STATUS "Build without ICU (support for collations and charset conversion functions will be disabled)")
return()
endif()
option (USE_INTERNAL_ICU_LIBRARY "Set to FALSE to use system ICU library instead of bundled" ${NOT_UNBUNDLED}) option (USE_INTERNAL_ICU_LIBRARY "Set to FALSE to use system ICU library instead of bundled" ${NOT_UNBUNDLED})
if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/icu/icu4c/LICENSE") if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/icu/icu4c/LICENSE")
if (USE_INTERNAL_ICU_LIBRARY) if (USE_INTERNAL_ICU_LIBRARY)
message (WARNING "submodule contrib/icu is missing. to fix try run: \n git submodule update --init --recursive") message (WARNING "submodule contrib/icu is missing. to fix try run: \n git submodule update --init --recursive")
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find internal ICU")
set (USE_INTERNAL_ICU_LIBRARY 0) set (USE_INTERNAL_ICU_LIBRARY 0)
endif () endif ()
set (MISSING_INTERNAL_ICU_LIBRARY 1) set (MISSING_INTERNAL_ICU_LIBRARY 1)
@ -31,8 +24,6 @@ if(NOT USE_INTERNAL_ICU_LIBRARY)
#set (ICU_LIBRARIES ${ICU_I18N_LIBRARY} ${ICU_UC_LIBRARY} ${ICU_DATA_LIBRARY} CACHE STRING "") #set (ICU_LIBRARIES ${ICU_I18N_LIBRARY} ${ICU_UC_LIBRARY} ${ICU_DATA_LIBRARY} CACHE STRING "")
if(ICU_FOUND) if(ICU_FOUND)
set(USE_ICU 1) set(USE_ICU 1)
else()
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find system ICU")
endif() endif()
endif() endif()
@ -44,6 +35,8 @@ elseif (NOT MISSING_INTERNAL_ICU_LIBRARY)
set (USE_ICU 1) set (USE_ICU 1)
endif () endif ()
endif()
if(USE_ICU) if(USE_ICU)
message(STATUS "Using icu=${USE_ICU}: ${ICU_INCLUDE_DIR} : ${ICU_LIBRARIES}") message(STATUS "Using icu=${USE_ICU}: ${ICU_INCLUDE_DIR} : ${ICU_LIBRARIES}")
else() else()

View File

@ -1,18 +1,11 @@
option (ENABLE_LDAP "Enable LDAP" ${ENABLE_LIBRARIES}) option (ENABLE_LDAP "Enable LDAP" ${ENABLE_LIBRARIES})
if (NOT ENABLE_LDAP) if (ENABLE_LDAP)
if(USE_INTERNAL_LDAP_LIBRARY)
message (${RECONFIGURE_MESSAGE_LEVEL} "Cannot use internal LDAP library with ENABLE_LDAP=OFF")
endif ()
return()
endif()
option (USE_INTERNAL_LDAP_LIBRARY "Set to FALSE to use system *LDAP library instead of bundled" ${NOT_UNBUNDLED}) option (USE_INTERNAL_LDAP_LIBRARY "Set to FALSE to use system *LDAP library instead of bundled" ${NOT_UNBUNDLED})
if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/openldap/README") if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/openldap/README")
if (USE_INTERNAL_LDAP_LIBRARY) if (USE_INTERNAL_LDAP_LIBRARY)
message (WARNING "Submodule contrib/openldap is missing. To fix try running:\n git submodule update --init --recursive") message (WARNING "Submodule contrib/openldap is missing. To fix try running:\n git submodule update --init --recursive")
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find internal LDAP library")
endif () endif ()
set (USE_INTERNAL_LDAP_LIBRARY 0) set (USE_INTERNAL_LDAP_LIBRARY 0)
@ -25,7 +18,6 @@ set (OPENLDAP_USE_REENTRANT_LIBS 1)
if (NOT USE_INTERNAL_LDAP_LIBRARY) if (NOT USE_INTERNAL_LDAP_LIBRARY)
if (OPENLDAP_USE_STATIC_LIBS) if (OPENLDAP_USE_STATIC_LIBS)
message (WARNING "Unable to use external static OpenLDAP libraries, falling back to the bundled version.") message (WARNING "Unable to use external static OpenLDAP libraries, falling back to the bundled version.")
message (${RECONFIGURE_MESSAGE_LEVEL} "Unable to use external OpenLDAP")
set (USE_INTERNAL_LDAP_LIBRARY 1) set (USE_INTERNAL_LDAP_LIBRARY 1)
else () else ()
if (APPLE AND NOT OPENLDAP_ROOT_DIR) if (APPLE AND NOT OPENLDAP_ROOT_DIR)
@ -33,10 +25,6 @@ if (NOT USE_INTERNAL_LDAP_LIBRARY)
endif () endif ()
find_package (OpenLDAP) find_package (OpenLDAP)
if (NOT OPENLDAP_FOUND)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find system OpenLDAP")
endif()
endif () endif ()
endif () endif ()
@ -66,10 +54,8 @@ if (NOT OPENLDAP_FOUND AND NOT MISSING_INTERNAL_LDAP_LIBRARY)
if (NOT _ldap_supported_platform) if (NOT _ldap_supported_platform)
message (WARNING "LDAP support using the bundled library is not implemented for ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_PROCESSOR} platform.") message (WARNING "LDAP support using the bundled library is not implemented for ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_PROCESSOR} platform.")
message (${RECONFIGURE_MESSAGE_LEVEL} "Cannot enable LDAP support")
elseif (NOT USE_SSL) elseif (NOT USE_SSL)
message (WARNING "LDAP support using the bundled library is not possible if SSL is not used.") message (WARNING "LDAP support using the bundled library is not possible if SSL is not used.")
message (${RECONFIGURE_MESSAGE_LEVEL} "Cannot enable LDAP support")
else () else ()
set (USE_INTERNAL_LDAP_LIBRARY 1) set (USE_INTERNAL_LDAP_LIBRARY 1)
set (OPENLDAP_ROOT_DIR "${ClickHouse_SOURCE_DIR}/contrib/openldap") set (OPENLDAP_ROOT_DIR "${ClickHouse_SOURCE_DIR}/contrib/openldap")
@ -93,5 +79,6 @@ endif ()
if (OPENLDAP_FOUND) if (OPENLDAP_FOUND)
set (USE_LDAP 1) set (USE_LDAP 1)
endif () endif ()
endif ()
message (STATUS "Using ldap=${USE_LDAP}: ${OPENLDAP_INCLUDE_DIRS} : ${OPENLDAP_LIBRARIES}") message (STATUS "Using ldap=${USE_LDAP}: ${OPENLDAP_INCLUDE_DIRS} : ${OPENLDAP_LIBRARIES}")

View File

@ -1,18 +1,12 @@
option(ENABLE_GSASL_LIBRARY "Enable gsasl library" ${ENABLE_LIBRARIES}) option(ENABLE_GSASL_LIBRARY "Enable gsasl library" ${ENABLE_LIBRARIES})
if (NOT ENABLE_GSASL_LIBRARY) if (ENABLE_GSASL_LIBRARY)
if(USE_INTERNAL_LIBGSASL_LIBRARY)
message (${RECONFIGURE_MESSAGE_LEVEL} "Cannot use internal libgsasl library with ENABLE_GSASL_LIBRARY=OFF")
endif()
return()
endif()
option (USE_INTERNAL_LIBGSASL_LIBRARY "Set to FALSE to use system libgsasl library instead of bundled" ${NOT_UNBUNDLED}) option (USE_INTERNAL_LIBGSASL_LIBRARY "Set to FALSE to use system libgsasl library instead of bundled" ${NOT_UNBUNDLED})
if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/libgsasl/src/gsasl.h") if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/libgsasl/src/gsasl.h")
if (USE_INTERNAL_LIBGSASL_LIBRARY) if (USE_INTERNAL_LIBGSASL_LIBRARY)
message (WARNING "submodule contrib/libgsasl is missing. to fix try run: \n git submodule update --init --recursive") message (WARNING "submodule contrib/libgsasl is missing. to fix try run: \n git submodule update --init --recursive")
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find internal libgsasl")
set (USE_INTERNAL_LIBGSASL_LIBRARY 0) set (USE_INTERNAL_LIBGSASL_LIBRARY 0)
endif () endif ()
set (MISSING_INTERNAL_LIBGSASL_LIBRARY 1) set (MISSING_INTERNAL_LIBGSASL_LIBRARY 1)
@ -21,14 +15,11 @@ endif ()
if (NOT USE_INTERNAL_LIBGSASL_LIBRARY) if (NOT USE_INTERNAL_LIBGSASL_LIBRARY)
find_library (LIBGSASL_LIBRARY gsasl) find_library (LIBGSASL_LIBRARY gsasl)
find_path (LIBGSASL_INCLUDE_DIR NAMES gsasl.h PATHS ${LIBGSASL_INCLUDE_PATHS}) find_path (LIBGSASL_INCLUDE_DIR NAMES gsasl.h PATHS ${LIBGSASL_INCLUDE_PATHS})
if (NOT LIBGSASL_LIBRARY OR NOT LIBGSASL_INCLUDE_DIR)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find system libgsasl")
endif ()
endif () endif ()
if (LIBGSASL_LIBRARY AND LIBGSASL_INCLUDE_DIR) if (LIBGSASL_LIBRARY AND LIBGSASL_INCLUDE_DIR)
elseif (NOT MISSING_INTERNAL_LIBGSASL_LIBRARY) elseif (NOT MISSING_INTERNAL_LIBGSASL_LIBRARY)
set (LIBGSASL_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/libgsasl/src" "${ClickHouse_SOURCE_DIR}/contrib/libgsasl/linux_x86_64/include") set (LIBGSASL_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/contrib/libgsasl/src ${ClickHouse_SOURCE_DIR}/contrib/libgsasl/linux_x86_64/include)
set (USE_INTERNAL_LIBGSASL_LIBRARY 1) set (USE_INTERNAL_LIBGSASL_LIBRARY 1)
set (LIBGSASL_LIBRARY libgsasl) set (LIBGSASL_LIBRARY libgsasl)
endif () endif ()
@ -37,4 +28,6 @@ if(LIBGSASL_LIBRARY AND LIBGSASL_INCLUDE_DIR)
set (USE_LIBGSASL 1) set (USE_LIBGSASL 1)
endif() endif()
endif()
message (STATUS "Using libgsasl=${USE_LIBGSASL}: ${LIBGSASL_INCLUDE_DIR} : ${LIBGSASL_LIBRARY}") message (STATUS "Using libgsasl=${USE_LIBGSASL}: ${LIBGSASL_INCLUDE_DIR} : ${LIBGSASL_LIBRARY}")

View File

@ -3,7 +3,6 @@ option (USE_INTERNAL_LIBXML2_LIBRARY "Set to FALSE to use system libxml2 library
if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/libxml2/libxml.h") if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/libxml2/libxml.h")
if (USE_INTERNAL_LIBXML2_LIBRARY) if (USE_INTERNAL_LIBXML2_LIBRARY)
message (WARNING "submodule contrib/libxml2 is missing. to fix try run: \n git submodule update --init --recursive") message (WARNING "submodule contrib/libxml2 is missing. to fix try run: \n git submodule update --init --recursive")
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find internal libxml")
set (USE_INTERNAL_LIBXML2_LIBRARY 0) set (USE_INTERNAL_LIBXML2_LIBRARY 0)
endif () endif ()
set (MISSING_INTERNAL_LIBXML2_LIBRARY 1) set (MISSING_INTERNAL_LIBXML2_LIBRARY 1)
@ -13,10 +12,6 @@ if (NOT USE_INTERNAL_LIBXML2_LIBRARY)
find_package (LibXml2) find_package (LibXml2)
#find_library (LIBXML2_LIBRARY libxml2) #find_library (LIBXML2_LIBRARY libxml2)
#find_path (LIBXML2_INCLUDE_DIR NAMES libxml.h PATHS ${LIBXML2_INCLUDE_PATHS}) #find_path (LIBXML2_INCLUDE_DIR NAMES libxml.h PATHS ${LIBXML2_INCLUDE_PATHS})
if (NOT LIBXML2_LIBRARY OR NOT LIBXML2_INCLUDE_DIR)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find system libxml2")
endif ()
endif () endif ()
if (LIBXML2_LIBRARY AND LIBXML2_INCLUDE_DIR) if (LIBXML2_LIBRARY AND LIBXML2_INCLUDE_DIR)

View File

@ -2,20 +2,11 @@
if (NOT APPLE) if (NOT APPLE)
option (ENABLE_EMBEDDED_COMPILER "Set to TRUE to enable support for 'compile_expressions' option for query execution" ${ENABLE_LIBRARIES}) option (ENABLE_EMBEDDED_COMPILER "Set to TRUE to enable support for 'compile_expressions' option for query execution" ${ENABLE_LIBRARIES})
option (USE_INTERNAL_LLVM_LIBRARY "Use bundled or system LLVM library." ${NOT_UNBUNDLED}) option (USE_INTERNAL_LLVM_LIBRARY "Use bundled or system LLVM library." ${NOT_UNBUNDLED})
elseif(ENABLE_EMBEDDED_COMPILER OR USE_INTERNAL_LLVM_LIBRARY)
message (${RECONFIGURE_MESSAGE_LEVEL} "Embedded compiler is not currently supported on Apple")
endif ()
if (NOT ENABLE_EMBEDDED_COMPILER)
if(USE_INTERNAL_LLVM_LIBRARY)
message (${RECONFIGURE_MESSAGE_LEVEL} "Cannot use internal LLVM library with ENABLE_EMBEDDED_COMPILER=OFF")
endif()
return()
endif () endif ()
if (ENABLE_EMBEDDED_COMPILER)
if (USE_INTERNAL_LLVM_LIBRARY AND NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/llvm/llvm/CMakeLists.txt") if (USE_INTERNAL_LLVM_LIBRARY AND NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/llvm/llvm/CMakeLists.txt")
message (WARNING "submodule contrib/llvm is missing. to fix try run: \n git submodule update --init --recursive") message (WARNING "submodule contrib/llvm is missing. to fix try run: \n git submodule update --init --recursive")
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't fidd internal LLVM library")
set (USE_INTERNAL_LLVM_LIBRARY 0) set (USE_INTERNAL_LLVM_LIBRARY 0)
endif () endif ()
@ -36,13 +27,11 @@ if (NOT USE_INTERNAL_LLVM_LIBRARY)
option(LLVM_HAS_RTTI "Enable if LLVM was build with RTTI enabled" ON) option(LLVM_HAS_RTTI "Enable if LLVM was build with RTTI enabled" ON)
set (USE_EMBEDDED_COMPILER 1) set (USE_EMBEDDED_COMPILER 1)
else() else()
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find system LLVM")
set (USE_EMBEDDED_COMPILER 0) set (USE_EMBEDDED_COMPILER 0)
endif() endif()
if (LLVM_FOUND AND OS_LINUX AND USE_LIBCXX) if (LLVM_FOUND AND OS_LINUX AND USE_LIBCXX)
message(WARNING "Option USE_INTERNAL_LLVM_LIBRARY is not set but the LLVM library from OS packages in Linux is incompatible with libc++ ABI. LLVM Will be disabled.") message(WARNING "Option USE_INTERNAL_LLVM_LIBRARY is not set but the LLVM library from OS packages in Linux is incompatible with libc++ ABI. LLVM Will be disabled.")
message (${RECONFIGURE_MESSAGE_LEVEL} "Unsupported LLVM configuration, cannot enable LLVM")
set (LLVM_FOUND 0) set (LLVM_FOUND 0)
set (USE_EMBEDDED_COMPILER 0) set (USE_EMBEDDED_COMPILER 0)
endif () endif ()
@ -82,9 +71,9 @@ if (LLVM_FOUND)
message(STATUS "LLVM include Directory: ${LLVM_INCLUDE_DIRS}") message(STATUS "LLVM include Directory: ${LLVM_INCLUDE_DIRS}")
message(STATUS "LLVM library Directory: ${LLVM_LIBRARY_DIRS}") message(STATUS "LLVM library Directory: ${LLVM_LIBRARY_DIRS}")
message(STATUS "LLVM C++ compiler flags: ${LLVM_CXXFLAGS}") message(STATUS "LLVM C++ compiler flags: ${LLVM_CXXFLAGS}")
else()
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't enable LLVM")
endif() endif()
endif()
# This list was generated by listing all LLVM libraries, compiling the binary and removing all libraries while it still compiles. # This list was generated by listing all LLVM libraries, compiling the binary and removing all libraries while it still compiles.
set (REQUIRED_LLVM_LIBRARIES set (REQUIRED_LLVM_LIBRARIES

View File

@ -1,5 +1,5 @@
if (ENABLE_ODBC AND NOT USE_INTERNAL_ODBC_LIBRARY) if (ENABLE_ODBC AND NOT USE_INTERNAL_ODBC_LIBRARY)
set (LTDL_PATHS "/usr/local/opt/libtool/lib") set (LTDL_PATHS "/usr/local/opt/libtool/lib")
find_library (LTDL_LIBRARY ltdl PATHS ${LTDL_PATHS} REQUIRED) find_library (LTDL_LIBRARY ltdl PATHS ${LTDL_PATHS})
message (STATUS "Using ltdl: ${LTDL_LIBRARY}") message (STATUS "Using ltdl: ${LTDL_LIBRARY}")
endif () endif ()

View File

@ -1,37 +1,27 @@
option (ENABLE_MSGPACK "Enable msgpack library" ${ENABLE_LIBRARIES}) option (ENABLE_MSGPACK "Enable msgpack library" ${ENABLE_LIBRARIES})
if(NOT ENABLE_MSGPACK) if (ENABLE_MSGPACK)
if(USE_INTERNAL_MSGPACK_LIBRARY)
message (${RECONFIGURE_MESSAGE_LEVEL} "Cannot use internal msgpack with ENABLE_MSGPACK=OFF")
endif()
return()
endif()
option (USE_INTERNAL_MSGPACK_LIBRARY "Set to FALSE to use system msgpack library instead of bundled" ${NOT_UNBUNDLED}) option (USE_INTERNAL_MSGPACK_LIBRARY "Set to FALSE to use system msgpack library instead of bundled" ${NOT_UNBUNDLED})
if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/msgpack-c/include/msgpack.hpp")
if (USE_INTERNAL_MSGPACK_LIBRARY) if (USE_INTERNAL_MSGPACK_LIBRARY)
if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/msgpack-c/include/msgpack.hpp")
message(WARNING "Submodule contrib/msgpack-c is missing. To fix try run: \n git submodule update --init --recursive") message(WARNING "Submodule contrib/msgpack-c is missing. To fix try run: \n git submodule update --init --recursive")
message (${RECONFIGURE_MESSAGE_LEVEL} "Cannot use internal msgpack")
set(USE_INTERNAL_MSGPACK_LIBRARY 0) set(USE_INTERNAL_MSGPACK_LIBRARY 0)
endif()
set(MISSING_INTERNAL_MSGPACK_LIBRARY 1) set(MISSING_INTERNAL_MSGPACK_LIBRARY 1)
endif() endif()
endif()
if(NOT USE_INTERNAL_MSGPACK_LIBRARY) if (USE_INTERNAL_MSGPACK_LIBRARY)
set(MSGPACK_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/contrib/msgpack-c/include)
else()
find_path(MSGPACK_INCLUDE_DIR NAMES msgpack.hpp PATHS ${MSGPACK_INCLUDE_PATHS}) find_path(MSGPACK_INCLUDE_DIR NAMES msgpack.hpp PATHS ${MSGPACK_INCLUDE_PATHS})
if(NOT MSGPACK_INCLUDE_DIR)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find system msgpack")
endif()
endif()
if(NOT MSGPACK_INCLUDE_DIR AND NOT MISSING_INTERNAL_MSGPACK_LIBRARY)
set(MSGPACK_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/msgpack-c/include")
set(USE_INTERNAL_MSGPACK_LIBRARY 1)
endif() endif()
if (MSGPACK_INCLUDE_DIR) if (MSGPACK_INCLUDE_DIR)
set(USE_MSGPACK 1) set(USE_MSGPACK 1)
endif() endif()
endif()
message(STATUS "Using msgpack=${USE_MSGPACK}: ${MSGPACK_INCLUDE_DIR}") message(STATUS "Using msgpack=${USE_MSGPACK}: ${MSGPACK_INCLUDE_DIR}")

View File

@ -4,26 +4,19 @@ else ()
option(ENABLE_MYSQL "Enable MySQL" FALSE) option(ENABLE_MYSQL "Enable MySQL" FALSE)
endif () endif ()
if(NOT ENABLE_MYSQL) if(ENABLE_MYSQL)
if (USE_INTERNAL_MYSQL_LIBRARY)
message (${RECONFIGURE_MESSAGE_LEVEL} "Cannot use internal mysql library with ENABLE_MYSQL=OFF")
endif ()
message (STATUS "Build without mysqlclient (support for MYSQL dictionary source will be disabled)")
return()
endif()
option(USE_INTERNAL_MYSQL_LIBRARY "Set to FALSE to use system mysqlclient library instead of bundled" ${NOT_UNBUNDLED}) option(USE_INTERNAL_MYSQL_LIBRARY "Set to FALSE to use system mysqlclient library instead of bundled" ${NOT_UNBUNDLED})
if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/mariadb-connector-c/README") if(USE_INTERNAL_MYSQL_LIBRARY AND NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/mariadb-connector-c/README")
if(USE_INTERNAL_MYSQL_LIBRARY)
message(WARNING "submodule contrib/mariadb-connector-c is missing. to fix try run: \n git submodule update --init --recursive") message(WARNING "submodule contrib/mariadb-connector-c is missing. to fix try run: \n git submodule update --init --recursive")
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find internal mysql library")
set(USE_INTERNAL_MYSQL_LIBRARY 0) set(USE_INTERNAL_MYSQL_LIBRARY 0)
endif() endif()
set(MISSING_INTERNAL_MYSQL_LIBRARY 1)
endif()
if (NOT USE_INTERNAL_MYSQL_LIBRARY) if (USE_INTERNAL_MYSQL_LIBRARY)
set (MYSQLCLIENT_LIBRARIES mariadbclient)
set (USE_MYSQL 1)
set (MYSQLXX_LIBRARY mysqlxx)
else ()
set (MYSQL_LIB_PATHS set (MYSQL_LIB_PATHS
"/usr/local/opt/mysql/lib" "/usr/local/opt/mysql/lib"
"/usr/local/lib" "/usr/local/lib"
@ -57,16 +50,8 @@ if (NOT USE_INTERNAL_MYSQL_LIBRARY)
# /usr/local/include/mysql/mysql_com.h:1011:10: fatal error: mysql/udf_registration_types.h: No such file or directory # /usr/local/include/mysql/mysql_com.h:1011:10: fatal error: mysql/udf_registration_types.h: No such file or directory
set(MYSQL_INCLUDE_DIR ${MYSQL_INCLUDE_DIR} ${MYSQL_INCLUDE_DIR}/mysql) set(MYSQL_INCLUDE_DIR ${MYSQL_INCLUDE_DIR} ${MYSQL_INCLUDE_DIR}/mysql)
endif () endif ()
else ()
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find system mysql library")
endif () endif ()
endif () endif ()
if (NOT USE_MYSQL AND NOT MISSING_INTERNAL_MYSQL_LIBRARY)
set (MYSQLCLIENT_LIBRARIES mariadbclient)
set (MYSQLXX_LIBRARY mysqlxx)
set (USE_MYSQL 1)
set (USE_INTERNAL_MYSQL_LIBRARY 1)
endif () endif ()
if (USE_MYSQL) if (USE_MYSQL)

View File

@ -3,14 +3,12 @@ if(0)
option(ENABLE_OPENCL "Enable OpenCL support" ${ENABLE_LIBRARIES}) option(ENABLE_OPENCL "Enable OpenCL support" ${ENABLE_LIBRARIES})
endif() endif()
if(NOT ENABLE_OPENCL) if(ENABLE_OPENCL)
return()
endif()
# Intel OpenCl driver: sudo apt install intel-opencl-icd # Intel OpenCl driver: sudo apt install intel-opencl-icd
# @sa https://github.com/intel/compute-runtime/releases # @sa https://github.com/intel/compute-runtime/releases
# OpenCL applications should link with ICD loader # OpenCL applications should link wiht ICD loader
# sudo apt install opencl-headers ocl-icd-libopencl1 # sudo apt install opencl-headers ocl-icd-libopencl1
# sudo ln -s /usr/lib/x86_64-linux-gnu/libOpenCL.so.1.0.0 /usr/lib/libOpenCL.so # sudo ln -s /usr/lib/x86_64-linux-gnu/libOpenCL.so.1.0.0 /usr/lib/libOpenCL.so
# TODO: add https://github.com/OCL-dev/ocl-icd as submodule instead # TODO: add https://github.com/OCL-dev/ocl-icd as submodule instead
@ -18,8 +16,8 @@ endif()
find_package(OpenCL) find_package(OpenCL)
if(OpenCL_FOUND) if(OpenCL_FOUND)
set(USE_OPENCL 1) set(USE_OPENCL 1)
else() endif()
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't enable OpenCL support")
endif() endif()
message(STATUS "Using opencl=${USE_OPENCL}: ${OpenCL_INCLUDE_DIRS} : ${OpenCL_LIBRARIES}") message(STATUS "Using opencl=${USE_OPENCL}: ${OpenCL_INCLUDE_DIRS} : ${OpenCL_LIBRARIES}")

View File

@ -1,20 +1,12 @@
option (ENABLE_ORC "Enable ORC" ${ENABLE_LIBRARIES}) option (ENABLE_ORC "Enable ORC" ${ENABLE_LIBRARIES})
if(NOT ENABLE_ORC) if(ENABLE_ORC)
if(USE_INTERNAL_ORC_LIBRARY)
message (${RECONFIGURE_MESSAGE_LEVEL} "Cannot use internal ORC library with ENABLE_ORD=OFF")
endif()
return()
endif()
option(USE_INTERNAL_ORC_LIBRARY "Set to FALSE to use system ORC instead of bundled" ${NOT_UNBUNDLED})
include(cmake/find/snappy.cmake) include(cmake/find/snappy.cmake)
option(USE_INTERNAL_ORC_LIBRARY "Set to FALSE to use system ORC instead of bundled" ${NOT_UNBUNDLED})
if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/orc/c++/include/orc/OrcFile.hh") if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/orc/c++/include/orc/OrcFile.hh")
if(USE_INTERNAL_ORC_LIBRARY) if(USE_INTERNAL_ORC_LIBRARY)
message(WARNING "submodule contrib/orc is missing. to fix try run: \n git submodule update --init --recursive") message(WARNING "submodule contrib/orc is missing. to fix try run: \n git submodule update --init --recursive")
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find internal ORC")
set(USE_INTERNAL_ORC_LIBRARY 0) set(USE_INTERNAL_ORC_LIBRARY 0)
endif() endif()
set(MISSING_INTERNAL_ORC_LIBRARY 1) set(MISSING_INTERNAL_ORC_LIBRARY 1)
@ -22,9 +14,6 @@ endif ()
if (NOT USE_INTERNAL_ORC_LIBRARY) if (NOT USE_INTERNAL_ORC_LIBRARY)
find_package(orc) find_package(orc)
if (NOT ORC_LIBRARY OR NOT ORC_INCLUDE_DIR)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find system ORC")
endif ()
endif () endif ()
#if (USE_INTERNAL_ORC_LIBRARY) #if (USE_INTERNAL_ORC_LIBRARY)
@ -41,10 +30,10 @@ elseif(NOT MISSING_INTERNAL_ORC_LIBRARY AND ARROW_LIBRARY AND SNAPPY_LIBRARY) #
set(ORC_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/orc/c++/include") set(ORC_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/orc/c++/include")
set(ORC_LIBRARY orc) set(ORC_LIBRARY orc)
set(USE_ORC 1) set(USE_ORC 1)
set(USE_INTERNAL_ORC_LIBRARY 1)
else() else()
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't enable ORC support - missing dependencies")
set(USE_INTERNAL_ORC_LIBRARY 0) set(USE_INTERNAL_ORC_LIBRARY 0)
endif() endif()
endif()
message (STATUS "Using internal=${USE_INTERNAL_ORC_LIBRARY} orc=${USE_ORC}: ${ORC_INCLUDE_DIR} : ${ORC_LIBRARY}") message (STATUS "Using internal=${USE_INTERNAL_ORC_LIBRARY} orc=${USE_ORC}: ${ORC_INCLUDE_DIR} : ${ORC_LIBRARY}")

View File

@ -1,39 +1,24 @@
if (Protobuf_PROTOC_EXECUTABLE) if (Protobuf_PROTOC_EXECUTABLE)
option (ENABLE_PARQUET "Enable parquet" ${ENABLE_LIBRARIES}) option (ENABLE_PARQUET "Enable parquet" ${ENABLE_LIBRARIES})
elseif(ENABLE_PARQUET OR USE_INTERNAL_PARQUET_LIBRARY)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't use parquet without protoc executable")
endif() endif()
if (NOT ENABLE_PARQUET) if (ENABLE_PARQUET)
if(USE_INTERNAL_PARQUET_LIBRARY)
message (${RECONFIGURE_MESSAGE_LEVEL} "Cannot use internal parquet with ENABLE_PARQUET=OFF")
endif()
message(STATUS "Building without Parquet support")
return()
endif()
if (NOT OS_FREEBSD) # Freebsd: ../contrib/arrow/cpp/src/arrow/util/bit-util.h:27:10: fatal error: endian.h: No such file or directory if (NOT OS_FREEBSD) # Freebsd: ../contrib/arrow/cpp/src/arrow/util/bit-util.h:27:10: fatal error: endian.h: No such file or directory
option(USE_INTERNAL_PARQUET_LIBRARY "Set to FALSE to use system parquet library instead of bundled" ${NOT_UNBUNDLED}) option(USE_INTERNAL_PARQUET_LIBRARY "Set to FALSE to use system parquet library instead of bundled" ${NOT_UNBUNDLED})
elseif(USE_INTERNAL_PARQUET_LIBRARY)
message (${RECONFIGURE_MESSAGE_LEVEL} "Using internal parquet is not supported on freebsd")
endif() endif()
if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/arrow/cpp/CMakeLists.txt") if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/arrow/cpp/CMakeLists.txt")
if(USE_INTERNAL_PARQUET_LIBRARY) if(USE_INTERNAL_PARQUET_LIBRARY)
message(WARNING "submodule contrib/arrow (required for Parquet) is missing. to fix try run: \n git submodule update --init --recursive") message(WARNING "submodule contrib/arrow (required for Parquet) is missing. to fix try run: \n git submodule update --init --recursive")
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't use internal parquet library")
set(USE_INTERNAL_PARQUET_LIBRARY 0)
endif() endif()
set(USE_INTERNAL_PARQUET_LIBRARY 0)
set(MISSING_INTERNAL_PARQUET_LIBRARY 1) set(MISSING_INTERNAL_PARQUET_LIBRARY 1)
endif() endif()
if(NOT USE_INTERNAL_PARQUET_LIBRARY) if(NOT USE_INTERNAL_PARQUET_LIBRARY)
find_package(Arrow) find_package(Arrow)
find_package(Parquet) find_package(Parquet)
if(NOT ARROW_INCLUDE_DIR OR PARQUET_INCLUDE_DIR)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find system parquet: arrow=${ARROW_INCLUDE_DIR} parquet=${PARQUET_INCLUDE_DIR}" )
endif()
endif() endif()
if(ARROW_INCLUDE_DIR AND PARQUET_INCLUDE_DIR) if(ARROW_INCLUDE_DIR AND PARQUET_INCLUDE_DIR)
@ -41,8 +26,6 @@ elseif(NOT MISSING_INTERNAL_PARQUET_LIBRARY AND NOT OS_FREEBSD)
include(cmake/find/snappy.cmake) include(cmake/find/snappy.cmake)
if(SNAPPY_LIBRARY) if(SNAPPY_LIBRARY)
set(CAN_USE_INTERNAL_PARQUET_LIBRARY 1) set(CAN_USE_INTERNAL_PARQUET_LIBRARY 1)
else()
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't use internal parquet library without snappy")
endif() endif()
include(CheckCXXSourceCompiles) include(CheckCXXSourceCompiles)
@ -55,13 +38,12 @@ elseif(NOT MISSING_INTERNAL_PARQUET_LIBRARY AND NOT OS_FREEBSD)
" HAVE_DOUBLE_CONVERSION_ALLOW_CASE_INSENSIBILITY) " HAVE_DOUBLE_CONVERSION_ALLOW_CASE_INSENSIBILITY)
if(NOT HAVE_DOUBLE_CONVERSION_ALLOW_CASE_INSENSIBILITY) # HAVE_STD_RANDOM_SHUFFLE if(NOT HAVE_DOUBLE_CONVERSION_ALLOW_CASE_INSENSIBILITY) # HAVE_STD_RANDOM_SHUFFLE
message (${RECONFIGURE_MESSAGE_LEVEL} "Disabling internal parquet library because arrow is broken (can't use old double_conversion)") message(STATUS "Disabling internal parquet library because arrow is broken (can't use old double_conversion)")
set(CAN_USE_INTERNAL_PARQUET_LIBRARY 0) set(CAN_USE_INTERNAL_PARQUET_LIBRARY 0)
endif() endif()
endif() endif()
if(NOT CAN_USE_INTERNAL_PARQUET_LIBRARY) if(NOT CAN_USE_INTERNAL_PARQUET_LIBRARY)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't use internal parquet")
set(USE_INTERNAL_PARQUET_LIBRARY 0) set(USE_INTERNAL_PARQUET_LIBRARY 0)
else() else()
set(USE_INTERNAL_PARQUET_LIBRARY 1) set(USE_INTERNAL_PARQUET_LIBRARY 1)
@ -71,7 +53,7 @@ elseif(NOT MISSING_INTERNAL_PARQUET_LIBRARY AND NOT OS_FREEBSD)
set(PARQUET_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/arrow/cpp/src" ${ClickHouse_BINARY_DIR}/contrib/arrow/cpp/src) set(PARQUET_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/arrow/cpp/src" ${ClickHouse_BINARY_DIR}/contrib/arrow/cpp/src)
endif() endif()
if(MAKE_STATIC_LIBRARIES) if(${USE_STATIC_LIBRARIES})
set(FLATBUFFERS_LIBRARY flatbuffers) set(FLATBUFFERS_LIBRARY flatbuffers)
set(ARROW_LIBRARY arrow_static) set(ARROW_LIBRARY arrow_static)
set(PARQUET_LIBRARY parquet_static) set(PARQUET_LIBRARY parquet_static)
@ -90,8 +72,8 @@ elseif(NOT MISSING_INTERNAL_PARQUET_LIBRARY AND NOT OS_FREEBSD)
set(USE_ORC 1) set(USE_ORC 1)
set(USE_ARROW 1) set(USE_ARROW 1)
endif() endif()
elseif(OS_FREEBSD) endif()
message (${RECONFIGURE_MESSAGE_LEVEL} "Using internal parquet library on FreeBSD is not supported")
endif() endif()
if(USE_PARQUET) if(USE_PARQUET)

View File

@ -1,18 +1,12 @@
option(ENABLE_PROTOBUF "Enable protobuf" ${ENABLE_LIBRARIES}) option(ENABLE_PROTOBUF "Enable protobuf" ${ENABLE_LIBRARIES})
if(NOT ENABLE_PROTOBUF) if(ENABLE_PROTOBUF)
if(USE_INTERNAL_PROTOBUF_LIBRARY)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't use internal protobuf with ENABLE_PROTOBUF=OFF")
endif()
return()
endif()
option(USE_INTERNAL_PROTOBUF_LIBRARY "Set to FALSE to use system protobuf instead of bundled" ${NOT_UNBUNDLED}) option(USE_INTERNAL_PROTOBUF_LIBRARY "Set to FALSE to use system protobuf instead of bundled" ${NOT_UNBUNDLED})
if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/protobuf/cmake/CMakeLists.txt") if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/protobuf/cmake/CMakeLists.txt")
if(USE_INTERNAL_PROTOBUF_LIBRARY) if(USE_INTERNAL_PROTOBUF_LIBRARY)
message(WARNING "submodule contrib/protobuf is missing. to fix try run: \n git submodule update --init --recursive") message(WARNING "submodule contrib/protobuf is missing. to fix try run: \n git submodule update --init --recursive")
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't use internal protobuf")
set(USE_INTERNAL_PROTOBUF_LIBRARY 0) set(USE_INTERNAL_PROTOBUF_LIBRARY 0)
endif() endif()
set(MISSING_INTERNAL_PROTOBUF_LIBRARY 1) set(MISSING_INTERNAL_PROTOBUF_LIBRARY 1)
@ -20,9 +14,6 @@ endif()
if(NOT USE_INTERNAL_PROTOBUF_LIBRARY) if(NOT USE_INTERNAL_PROTOBUF_LIBRARY)
find_package(Protobuf) find_package(Protobuf)
if (NOT Protobuf_LIBRARY OR NOT Protobuf_INCLUDE_DIR)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find system protobuf")
endif()
endif() endif()
if (Protobuf_LIBRARY AND Protobuf_INCLUDE_DIR) if (Protobuf_LIBRARY AND Protobuf_INCLUDE_DIR)
@ -45,11 +36,11 @@ if(OS_FREEBSD AND SANITIZE STREQUAL "address")
if(LLVM_INCLUDE_DIRS) if(LLVM_INCLUDE_DIRS)
set(Protobuf_INCLUDE_DIR ${Protobuf_INCLUDE_DIR} ${LLVM_INCLUDE_DIRS}) set(Protobuf_INCLUDE_DIR ${Protobuf_INCLUDE_DIR} ${LLVM_INCLUDE_DIRS})
else() else()
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't use protobuf on FreeBSD with address sanitizer without LLVM")
set(USE_PROTOBUF 0) set(USE_PROTOBUF 0)
endif() endif()
endif() endif()
include (${ClickHouse_SOURCE_DIR}/cmake/protobuf_generate_cpp.cmake) include (${ClickHouse_SOURCE_DIR}/cmake/protobuf_generate_cpp.cmake)
endif()
message(STATUS "Using protobuf=${USE_PROTOBUF}: ${Protobuf_INCLUDE_DIR} : ${Protobuf_LIBRARY} : ${Protobuf_PROTOC_EXECUTABLE}") message(STATUS "Using protobuf=${USE_PROTOBUF}: ${Protobuf_INCLUDE_DIR} : ${Protobuf_LIBRARY} : ${Protobuf_PROTOC_EXECUTABLE}")

View File

@ -1,8 +1,5 @@
option(ENABLE_RAPIDJSON "Use rapidjson" ${ENABLE_LIBRARIES}) option(ENABLE_RAPIDJSON "Use rapidjson" ${ENABLE_LIBRARIES})
if(NOT ENABLE_RAPIDJSON) if(NOT ENABLE_RAPIDJSON)
if(USE_INTERNAL_RAPIDJSON_LIBRARY)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't use internal rapidjson library with ENABLE_RAPIDJSON=OFF")
endif()
return() return()
endif() endif()
@ -11,7 +8,6 @@ option(USE_INTERNAL_RAPIDJSON_LIBRARY "Set to FALSE to use system rapidjson libr
if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/rapidjson/include/rapidjson/rapidjson.h") if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/rapidjson/include/rapidjson/rapidjson.h")
if(USE_INTERNAL_RAPIDJSON_LIBRARY) if(USE_INTERNAL_RAPIDJSON_LIBRARY)
message(WARNING "submodule contrib/rapidjson is missing. to fix try run: \n git submodule update --init --recursive") message(WARNING "submodule contrib/rapidjson is missing. to fix try run: \n git submodule update --init --recursive")
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find internal rapidjson library")
set(USE_INTERNAL_RAPIDJSON_LIBRARY 0) set(USE_INTERNAL_RAPIDJSON_LIBRARY 0)
endif() endif()
set(MISSING_INTERNAL_RAPIDJSON_LIBRARY 1) set(MISSING_INTERNAL_RAPIDJSON_LIBRARY 1)
@ -19,9 +15,6 @@ endif()
if(NOT USE_INTERNAL_RAPIDJSON_LIBRARY) if(NOT USE_INTERNAL_RAPIDJSON_LIBRARY)
find_path(RAPIDJSON_INCLUDE_DIR NAMES rapidjson/rapidjson.h PATHS ${RAPIDJSON_INCLUDE_PATHS}) find_path(RAPIDJSON_INCLUDE_DIR NAMES rapidjson/rapidjson.h PATHS ${RAPIDJSON_INCLUDE_PATHS})
if(NOT RAPIDJSON_INCLUDE_DIR)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find system rapidjson")
endif()
endif() endif()
if(RAPIDJSON_INCLUDE_DIR) if(RAPIDJSON_INCLUDE_DIR)

View File

@ -1,55 +1,30 @@
# Freebsd: contrib/cppkafka/include/cppkafka/detail/endianness.h:53:23: error: 'betoh16' was not declared in this scope # Freebsd: contrib/cppkafka/include/cppkafka/detail/endianness.h:53:23: error: 'betoh16' was not declared in this scope
if (NOT ARCH_ARM AND NOT OS_FREEBSD AND OPENSSL_FOUND) if (NOT ARCH_ARM AND NOT OS_FREEBSD AND OPENSSL_FOUND)
option (ENABLE_RDKAFKA "Enable kafka" ${ENABLE_LIBRARIES}) option (ENABLE_RDKAFKA "Enable kafka" ${ENABLE_LIBRARIES})
elseif(ENABLE_RDKAFKA AND NOT OPENSSL_FOUND)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't use librdkafka without SSL")
else(ENABLE_RDKAFKA)
message (${RECONFIGURE_MESSAGE_LEVEL} "librdafka is not supported on ARM and on FreeBSD")
endif ()
if (NOT ENABLE_RDKAFKA)
if (USE_INTERNAL_RDKAFKA_LIBRARY)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't use internal librdkafka with ENABLE_RDKAFKA=OFF")
endif()
return()
endif()
if (NOT ARCH_ARM AND USE_LIBGSASL)
option (USE_INTERNAL_RDKAFKA_LIBRARY "Set to FALSE to use system librdkafka instead of the bundled" ${NOT_UNBUNDLED})
elseif(USE_INTERNAL_RDKAFKA_LIBRARY)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't use internal librdkafka with ARCH_ARM=${ARCH_ARM} AND USE_LIBGSASL=${USE_LIBGSASL}")
endif () endif ()
if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/cppkafka/CMakeLists.txt") if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/cppkafka/CMakeLists.txt")
if(USE_INTERNAL_RDKAFKA_LIBRARY)
message (WARNING "submodule contrib/cppkafka is missing. to fix try run: \n git submodule update --init --recursive") message (WARNING "submodule contrib/cppkafka is missing. to fix try run: \n git submodule update --init --recursive")
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find internal cppkafka") set (ENABLE_RDKAFKA 0)
set (USE_INTERNAL_RDKAFKA_LIBRARY 0)
endif()
set (MISSING_INTERNAL_CPPKAFKA_LIBRARY 1)
endif () endif ()
if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/librdkafka/CMakeLists.txt") if (ENABLE_RDKAFKA)
if(USE_INTERNAL_RDKAFKA_LIBRARY OR MISSING_INTERNAL_CPPKAFKA_LIBRARY)
message (WARNING "submodule contrib/librdkafka is missing. to fix try run: \n git submodule update --init --recursive") if (NOT ARCH_ARM AND USE_LIBGSASL)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find internal rdkafka") option (USE_INTERNAL_RDKAFKA_LIBRARY "Set to FALSE to use system librdkafka instead of the bundled" ${NOT_UNBUNDLED})
set (USE_INTERNAL_RDKAFKA_LIBRARY 0)
endif () endif ()
if (USE_INTERNAL_RDKAFKA_LIBRARY AND NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/librdkafka/CMakeLists.txt")
message (WARNING "submodule contrib/librdkafka is missing. to fix try run: \n git submodule update --init --recursive")
set (USE_INTERNAL_RDKAFKA_LIBRARY 0)
set (MISSING_INTERNAL_RDKAFKA_LIBRARY 1) set (MISSING_INTERNAL_RDKAFKA_LIBRARY 1)
endif () endif ()
if (NOT USE_INTERNAL_RDKAFKA_LIBRARY) if (NOT USE_INTERNAL_RDKAFKA_LIBRARY)
find_library (RDKAFKA_LIB rdkafka) find_library (RDKAFKA_LIB rdkafka)
find_path (RDKAFKA_INCLUDE_DIR NAMES librdkafka/rdkafka.h PATHS ${RDKAFKA_INCLUDE_PATHS}) find_path (RDKAFKA_INCLUDE_DIR NAMES librdkafka/rdkafka.h PATHS ${RDKAFKA_INCLUDE_PATHS})
if (NOT RDKAFKA_LIB OR NOT RDKAFKA_INCLUDE_DIR)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find system librdkafka")
endif()
if (USE_STATIC_LIBRARIES AND NOT OS_FREEBSD) if (USE_STATIC_LIBRARIES AND NOT OS_FREEBSD)
find_library (SASL2_LIBRARY sasl2) find_library (SASL2_LIBRARY sasl2)
if (NOT SASL2_LIBRARY)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find system sasl2 library needed for static librdkafka")
endif()
endif () endif ()
set (CPPKAFKA_LIBRARY cppkafka) # TODO: try to use unbundled version. set (CPPKAFKA_LIBRARY cppkafka) # TODO: try to use unbundled version.
endif () endif ()
@ -64,14 +39,14 @@ if (RDKAFKA_LIB AND RDKAFKA_INCLUDE_DIR)
if (LZ4_LIBRARY) if (LZ4_LIBRARY)
list (APPEND RDKAFKA_LIBRARY ${LZ4_LIBRARY}) list (APPEND RDKAFKA_LIBRARY ${LZ4_LIBRARY})
endif () endif ()
elseif (NOT MISSING_INTERNAL_RDKAFKA_LIBRARY AND NOT MISSING_INTERNAL_CPPKAFKA_LIBRARY AND NOT ARCH_ARM) elseif (NOT MISSING_INTERNAL_RDKAFKA_LIBRARY AND NOT ARCH_ARM)
set (USE_INTERNAL_RDKAFKA_LIBRARY 1) set (USE_INTERNAL_RDKAFKA_LIBRARY 1)
set (RDKAFKA_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/librdkafka/src") set (RDKAFKA_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/librdkafka/src")
set (RDKAFKA_LIBRARY rdkafka) set (RDKAFKA_LIBRARY rdkafka)
set (CPPKAFKA_LIBRARY cppkafka) set (CPPKAFKA_LIBRARY cppkafka)
set (USE_RDKAFKA 1) set (USE_RDKAFKA 1)
elseif(ARCH_ARM) endif ()
message (${RECONFIGURE_MESSAGE_LEVEL} "Using internal rdkafka on ARM is not supported")
endif () endif ()
message (STATUS "Using librdkafka=${USE_RDKAFKA}: ${RDKAFKA_INCLUDE_DIR} : ${RDKAFKA_LIBRARY} ${CPPKAFKA_LIBRARY}") message (STATUS "Using librdkafka=${USE_RDKAFKA}: ${RDKAFKA_INCLUDE_DIR} : ${RDKAFKA_LIBRARY} ${CPPKAFKA_LIBRARY}")

View File

@ -3,7 +3,6 @@ option (USE_INTERNAL_RE2_LIBRARY "Set to FALSE to use system re2 library instead
if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/re2/CMakeLists.txt") if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/re2/CMakeLists.txt")
if(USE_INTERNAL_RE2_LIBRARY) if(USE_INTERNAL_RE2_LIBRARY)
message(WARNING "submodule contrib/re2 is missing. to fix try run: \n git submodule update --init --recursive") message(WARNING "submodule contrib/re2 is missing. to fix try run: \n git submodule update --init --recursive")
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find internal re2 library")
endif() endif()
set(USE_INTERNAL_RE2_LIBRARY 0) set(USE_INTERNAL_RE2_LIBRARY 0)
set(MISSING_INTERNAL_RE2_LIBRARY 1) set(MISSING_INTERNAL_RE2_LIBRARY 1)
@ -12,9 +11,6 @@ endif()
if (NOT USE_INTERNAL_RE2_LIBRARY) if (NOT USE_INTERNAL_RE2_LIBRARY)
find_library (RE2_LIBRARY re2) find_library (RE2_LIBRARY re2)
find_path (RE2_INCLUDE_DIR NAMES re2/re2.h PATHS ${RE2_INCLUDE_PATHS}) find_path (RE2_INCLUDE_DIR NAMES re2/re2.h PATHS ${RE2_INCLUDE_PATHS})
if (NOT RE2_LIBRARY OR NOT RE2_INCLUDE_DIR)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find system re2 library")
endif ()
endif () endif ()
string(FIND ${CMAKE_CURRENT_BINARY_DIR} " " _have_space) string(FIND ${CMAKE_CURRENT_BINARY_DIR} " " _have_space)
@ -28,13 +24,12 @@ if (RE2_LIBRARY AND RE2_INCLUDE_DIR)
elseif (NOT MISSING_INTERNAL_RE2_LIBRARY) elseif (NOT MISSING_INTERNAL_RE2_LIBRARY)
set (USE_INTERNAL_RE2_LIBRARY 1) set (USE_INTERNAL_RE2_LIBRARY 1)
set (RE2_LIBRARY re2) set (RE2_LIBRARY re2)
set (RE2_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/re2") set (RE2_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/contrib/re2)
if (NOT MISSING_INTERNAL_RE2_ST_LIBRARY) if (NOT MISSING_INTERNAL_RE2_ST_LIBRARY)
set (RE2_ST_LIBRARY re2_st) set (RE2_ST_LIBRARY re2_st)
set (USE_RE2_ST 1) set (USE_RE2_ST 1)
else () else ()
set (RE2_ST_LIBRARY ${RE2_LIBRARY}) set (RE2_ST_LIBRARY ${RE2_LIBRARY})
message (${RECONFIGURE_MESSAGE_LEVEL} "Using internal re2 library instead of re2_st")
endif () endif ()
endif () endif ()

View File

@ -1,26 +1,12 @@
if(NOT OS_FREEBSD AND NOT APPLE AND NOT ARCH_ARM) if(NOT OS_FREEBSD AND NOT APPLE AND NOT ARCH_ARM)
option(ENABLE_S3 "Enable S3" ${ENABLE_LIBRARIES}) option(ENABLE_S3 "Enable S3" ${ENABLE_LIBRARIES})
elseif(ENABLE_S3 OR USE_INTERNAL_AWS_S3_LIBRARY)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't use S3 on ARM, Apple or FreeBSD")
endif()
if(NOT ENABLE_S3)
if(USE_INTERNAL_AWS_S3_LIBRARY)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't use internal S3 library with ENABLE_S3=OFF")
endif()
return()
endif() endif()
if(ENABLE_S3)
option(USE_INTERNAL_AWS_S3_LIBRARY "Set to FALSE to use system S3 instead of bundled" ${NOT_UNBUNDLED}) option(USE_INTERNAL_AWS_S3_LIBRARY "Set to FALSE to use system S3 instead of bundled" ${NOT_UNBUNDLED})
if (NOT USE_INTERNAL_AWS_S3_LIBRARY)
message (${RECONFIGURE_MESSAGE_LEVEL} "Compilation with external S3 library is not supported yet")
endif()
if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/aws/aws-cpp-sdk-s3") if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/aws/aws-cpp-sdk-s3")
message (WARNING "submodule contrib/aws is missing. to fix try run: \n git submodule update --init --recursive") message (WARNING "submodule contrib/aws is missing. to fix try run: \n git submodule update --init --recursive")
if (USE_INTERNAL_AWS_S3_LIBRARY)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find internal S3 library")
endif ()
set (MISSING_AWS_S3 1) set (MISSING_AWS_S3 1)
endif () endif ()
@ -31,9 +17,10 @@ if (USE_INTERNAL_AWS_S3_LIBRARY AND NOT MISSING_AWS_S3)
set(USE_INTERNAL_AWS_S3_LIBRARY 1) set(USE_INTERNAL_AWS_S3_LIBRARY 1)
set(USE_AWS_S3 1) set(USE_AWS_S3 1)
else() else()
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't enable S3")
set(USE_INTERNAL_AWS_S3_LIBRARY 0) set(USE_INTERNAL_AWS_S3_LIBRARY 0)
set(USE_AWS_S3 0) set(USE_AWS_S3 0)
endif () endif ()
endif()
message (STATUS "Using aws_s3=${USE_AWS_S3}: ${AWS_S3_INCLUDE_DIR} : ${AWS_S3_LIBRARY}") message (STATUS "Using aws_s3=${USE_AWS_S3}: ${AWS_S3_INCLUDE_DIR} : ${AWS_S3_LIBRARY}")

View File

@ -2,9 +2,6 @@ set (SENTRY_LIBRARY "sentry")
set (SENTRY_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/sentry-native/include") set (SENTRY_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/sentry-native/include")
if (NOT EXISTS "${SENTRY_INCLUDE_DIR}/sentry.h") if (NOT EXISTS "${SENTRY_INCLUDE_DIR}/sentry.h")
message (WARNING "submodule contrib/sentry-native is missing. to fix try run: \n git submodule update --init --recursive") message (WARNING "submodule contrib/sentry-native is missing. to fix try run: \n git submodule update --init --recursive")
if (USE_SENTRY)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find internal sentry library")
endif()
return() return()
endif () endif ()
@ -19,6 +16,4 @@ if (NOT OS_FREEBSD AND NOT SPLIT_SHARED_LIBRARIES AND NOT_UNBUNDLED AND NOT (OS_
message (STATUS "Using sentry=${USE_SENTRY}: ${SENTRY_LIBRARY}") message (STATUS "Using sentry=${USE_SENTRY}: ${SENTRY_LIBRARY}")
include_directories("${SENTRY_INCLUDE_DIR}") include_directories("${SENTRY_INCLUDE_DIR}")
elseif (USE_SENTRY)
message (${RECONFIGURE_MESSAGE_LEVEL} "Sentry is not supported in current configuration")
endif () endif ()

View File

@ -1,11 +1,8 @@
option (USE_SIMDJSON "Use simdjson" ${ENABLE_LIBRARIES})
if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/simdjson/include/simdjson.h") if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/simdjson/include/simdjson.h")
message (WARNING "submodule contrib/simdjson is missing. to fix try run: \n git submodule update --init --recursive") message (WARNING "submodule contrib/simdjson is missing. to fix try run: \n git submodule update --init --recursive")
if (USE_SIMDJSON)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find internal simdjson library")
endif()
return() return()
endif () endif ()
option (USE_SIMDJSON "Use simdjson" ON)
message(STATUS "Using simdjson=${USE_SIMDJSON}") message(STATUS "Using simdjson=${USE_SIMDJSON}")

View File

@ -1,21 +1,13 @@
option(USE_SNAPPY "Enable support of snappy library" ${ENABLE_LIBRARIES}) option(USE_SNAPPY "Enable support of snappy library" ${ENABLE_LIBRARIES})
if(NOT USE_SNAPPY) if(USE_SNAPPY)
if (USE_INTERNAL_SNAPPY_LIBRARY)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't use internal snappy library with USE_SNAPPY=OFF")
endif()
return()
endif()
option (USE_INTERNAL_SNAPPY_LIBRARY "Set to FALSE to use system snappy library instead of bundled" ${NOT_UNBUNDLED}) option (USE_INTERNAL_SNAPPY_LIBRARY "Set to FALSE to use system snappy library instead of bundled" ${NOT_UNBUNDLED})
if(NOT USE_INTERNAL_SNAPPY_LIBRARY) if(NOT USE_INTERNAL_SNAPPY_LIBRARY)
find_library(SNAPPY_LIBRARY snappy) find_library(SNAPPY_LIBRARY snappy)
if (NOT SNAPPY_LIBRARY)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find system snappy library")
endif()
else () else ()
set(SNAPPY_LIBRARY snappy) set(SNAPPY_LIBRARY snappy)
endif() endif()
message (STATUS "Using snappy: ${SNAPPY_LIBRARY}") message (STATUS "Using snappy: ${SNAPPY_LIBRARY}")
endif ()

View File

@ -2,9 +2,6 @@ option (USE_INTERNAL_SPARSEHASH_LIBRARY "Set to FALSE to use system sparsehash l
if (NOT USE_INTERNAL_SPARSEHASH_LIBRARY) if (NOT USE_INTERNAL_SPARSEHASH_LIBRARY)
find_path (SPARSEHASH_INCLUDE_DIR NAMES sparsehash/sparse_hash_map PATHS ${SPARSEHASH_INCLUDE_PATHS}) find_path (SPARSEHASH_INCLUDE_DIR NAMES sparsehash/sparse_hash_map PATHS ${SPARSEHASH_INCLUDE_PATHS})
if (NOT SPARSEHASH_INCLUDE_DIR)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find system sparsehash library")
endif ()
endif () endif ()
if (SPARSEHASH_INCLUDE_DIR) if (SPARSEHASH_INCLUDE_DIR)

View File

@ -1,18 +1,12 @@
option(ENABLE_SSL "Enable ssl" ${ENABLE_LIBRARIES}) option(ENABLE_SSL "Enable ssl" ${ENABLE_LIBRARIES})
if(NOT ENABLE_SSL) if(ENABLE_SSL)
if (USE_INTERNAL_SSL_LIBRARY)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't use internal ssl library with ENABLE_SSL=OFF")
endif()
return()
endif()
option(USE_INTERNAL_SSL_LIBRARY "Set to FALSE to use system *ssl library instead of bundled" ${NOT_UNBUNDLED}) option(USE_INTERNAL_SSL_LIBRARY "Set to FALSE to use system *ssl library instead of bundled" ${NOT_UNBUNDLED})
if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/openssl/README") if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/openssl/README")
if(USE_INTERNAL_SSL_LIBRARY) if(USE_INTERNAL_SSL_LIBRARY)
message(WARNING "submodule contrib/openssl is missing. to fix try run: \n git submodule update --init --recursive") message(WARNING "submodule contrib/openssl is missing. to fix try run: \n git submodule update --init --recursive")
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find internal ssl library")
endif() endif()
set(USE_INTERNAL_SSL_LIBRARY 0) set(USE_INTERNAL_SSL_LIBRARY 0)
set(MISSING_INTERNAL_SSL_LIBRARY 1) set(MISSING_INTERNAL_SSL_LIBRARY 1)
@ -42,10 +36,6 @@ if (NOT USE_INTERNAL_SSL_LIBRARY)
set (OPENSSL_FOUND 1) set (OPENSSL_FOUND 1)
endif () endif ()
endif () endif ()
if (NOT OPENSSL_FOUND)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find system ssl")
endif()
endif () endif ()
if (NOT OPENSSL_FOUND AND NOT MISSING_INTERNAL_SSL_LIBRARY) if (NOT OPENSSL_FOUND AND NOT MISSING_INTERNAL_SSL_LIBRARY)
@ -133,4 +123,7 @@ if(OPENSSL_FOUND AND NOT USE_INTERNAL_SSL_LIBRARY)
endif() endif()
endif() endif()
endif ()
message (STATUS "Using ssl=${USE_SSL}: ${OPENSSL_INCLUDE_DIR} : ${OPENSSL_LIBRARIES}") message (STATUS "Using ssl=${USE_SSL}: ${OPENSSL_INCLUDE_DIR} : ${OPENSSL_LIBRARIES}")

View File

@ -14,10 +14,6 @@ if (ENABLE_STATS)
set(GCEM_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/contrib/gcem/include) set(GCEM_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/contrib/gcem/include)
set (USE_STATS 1) set (USE_STATS 1)
endif() endif()
if (NOT USE_STATS)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't enable stats library")
endif()
endif() endif()
message (STATUS "Using stats=${USE_STATS} : ${STATS_INCLUDE_DIR}") message (STATUS "Using stats=${USE_STATS} : ${STATS_INCLUDE_DIR}")

View File

@ -5,7 +5,4 @@ endif()
if (NOT TERMCAP_LIBRARY) if (NOT TERMCAP_LIBRARY)
find_library (TERMCAP_LIBRARY termcap) find_library (TERMCAP_LIBRARY termcap)
endif() endif()
if (NOT TERMCAP_LIBRARY)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find tinfo, ncurses or termcap library")
endif()
message (STATUS "Using termcap: ${TERMCAP_LIBRARY}") message (STATUS "Using termcap: ${TERMCAP_LIBRARY}")

View File

@ -6,14 +6,12 @@ else ()
set (INTERNAL_ZLIB_NAME "zlib" CACHE INTERNAL "") set (INTERNAL_ZLIB_NAME "zlib" CACHE INTERNAL "")
if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/${INTERNAL_ZLIB_NAME}") if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/${INTERNAL_ZLIB_NAME}")
message (WARNING "Will use standard zlib, please clone manually:\n git clone https://github.com/madler/zlib.git ${ClickHouse_SOURCE_DIR}/contrib/${INTERNAL_ZLIB_NAME}") message (WARNING "Will use standard zlib, please clone manually:\n git clone https://github.com/madler/zlib.git ${ClickHouse_SOURCE_DIR}/contrib/${INTERNAL_ZLIB_NAME}")
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't use internal zlib library")
endif () endif ()
endif () endif ()
if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/${INTERNAL_ZLIB_NAME}/zlib.h") if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/${INTERNAL_ZLIB_NAME}/zlib.h")
if(USE_INTERNAL_ZLIB_LIBRARY) if(USE_INTERNAL_ZLIB_LIBRARY)
message(WARNING "submodule contrib/${INTERNAL_ZLIB_NAME} is missing. to fix try run: \n git submodule update --init --recursive") message(WARNING "submodule contrib/${INTERNAL_ZLIB_NAME} is missing. to fix try run: \n git submodule update --init --recursive")
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find internal zlib library")
endif() endif()
set(USE_INTERNAL_ZLIB_LIBRARY 0) set(USE_INTERNAL_ZLIB_LIBRARY 0)
set(MISSING_INTERNAL_ZLIB_LIBRARY 1) set(MISSING_INTERNAL_ZLIB_LIBRARY 1)
@ -21,7 +19,6 @@ endif()
if (NOT USE_INTERNAL_ZLIB_LIBRARY) if (NOT USE_INTERNAL_ZLIB_LIBRARY)
find_package (ZLIB) find_package (ZLIB)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find system zlib library")
endif () endif ()
if (NOT ZLIB_FOUND AND NOT MISSING_INTERNAL_ZLIB_LIBRARY) if (NOT ZLIB_FOUND AND NOT MISSING_INTERNAL_ZLIB_LIBRARY)

View File

@ -3,18 +3,14 @@ option (USE_INTERNAL_ZSTD_LIBRARY "Set to FALSE to use system zstd library inste
if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/zstd/lib/zstd.h") if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/zstd/lib/zstd.h")
if(USE_INTERNAL_ZSTD_LIBRARY) if(USE_INTERNAL_ZSTD_LIBRARY)
message(WARNING "submodule contrib/zstd is missing. to fix try run: \n git submodule update --init --recursive") message(WARNING "submodule contrib/zstd is missing. to fix try run: \n git submodule update --init --recursive")
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find internal zstd library")
set(USE_INTERNAL_ZSTD_LIBRARY 0)
endif() endif()
set(USE_INTERNAL_ZSTD_LIBRARY 0)
set(MISSING_INTERNAL_ZSTD_LIBRARY 1) set(MISSING_INTERNAL_ZSTD_LIBRARY 1)
endif() endif()
if (NOT USE_INTERNAL_ZSTD_LIBRARY) if (NOT USE_INTERNAL_ZSTD_LIBRARY)
find_library (ZSTD_LIBRARY zstd) find_library (ZSTD_LIBRARY zstd)
find_path (ZSTD_INCLUDE_DIR NAMES zstd.h PATHS ${ZSTD_INCLUDE_PATHS}) find_path (ZSTD_INCLUDE_DIR NAMES zstd.h PATHS ${ZSTD_INCLUDE_PATHS})
if (NOT ZSTD_LIBRARY OR NOT ZSTD_INCLUDE_DIR)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find system zstd library")
endif ()
endif () endif ()
if (ZSTD_LIBRARY AND ZSTD_INCLUDE_DIR) if (ZSTD_LIBRARY AND ZSTD_INCLUDE_DIR)

View File

@ -41,16 +41,17 @@ STRING(REGEX MATCHALL "[0-9]+" COMPILER_VERSION_LIST ${CMAKE_CXX_COMPILER_VERSIO
LIST(GET COMPILER_VERSION_LIST 0 COMPILER_VERSION_MAJOR) LIST(GET COMPILER_VERSION_LIST 0 COMPILER_VERSION_MAJOR)
option (LINKER_NAME "Linker name or full path") option (LINKER_NAME "Linker name or full path")
if (COMPILER_GCC AND NOT LINKER_NAME) if (COMPILER_GCC)
find_program (LLD_PATH NAMES "ld.lld") find_program (LLD_PATH NAMES "ld.lld")
find_program (GOLD_PATH NAMES "ld.gold") find_program (GOLD_PATH NAMES "ld.gold")
elseif (NOT LINKER_NAME) else ()
find_program (LLD_PATH NAMES "ld.lld-${COMPILER_VERSION_MAJOR}" "lld-${COMPILER_VERSION_MAJOR}" "ld.lld" "lld") find_program (LLD_PATH NAMES "ld.lld-${COMPILER_VERSION_MAJOR}" "lld-${COMPILER_VERSION_MAJOR}" "ld.lld" "lld")
find_program (GOLD_PATH NAMES "ld.gold" "gold") find_program (GOLD_PATH NAMES "ld.gold" "gold")
endif () endif ()
if (OS_LINUX AND NOT LINKER_NAME) if (OS_LINUX)
# We prefer LLD linker over Gold or BFD on Linux. # We prefer LLD linker over Gold or BFD on Linux.
if (NOT LINKER_NAME)
if (LLD_PATH) if (LLD_PATH)
if (COMPILER_GCC) if (COMPILER_GCC)
# GCC driver requires one of supported linker names like "lld". # GCC driver requires one of supported linker names like "lld".
@ -60,6 +61,7 @@ if (OS_LINUX AND NOT LINKER_NAME)
set (LINKER_NAME ${LLD_PATH}) set (LINKER_NAME ${LLD_PATH})
endif () endif ()
endif () endif ()
endif ()
if (NOT LINKER_NAME) if (NOT LINKER_NAME)
if (GOLD_PATH) if (GOLD_PATH)

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 (MAKE_STATIC_LIBRARIES) if (${USE_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,52 +1,6 @@
option (USE_INTERNAL_BOOST_LIBRARY "Use internal Boost library" ${NOT_UNBUNDLED}) option (USE_INTERNAL_BOOST_LIBRARY "Use internal Boost library" ${NOT_UNBUNDLED})
if (NOT USE_INTERNAL_BOOST_LIBRARY) if (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
@ -142,4 +96,38 @@ if (NOT EXTERNAL_BOOST_FOUND)
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,42 +1,9 @@
option (USE_INTERNAL_CCTZ_LIBRARY "Use internal cctz library" ${NOT_UNBUNDLED}) option (USE_INTERNAL_CCTZ "Use internal cctz library" ${NOT_UNBUNDLED})
if (NOT USE_INTERNAL_CCTZ_LIBRARY) if (USE_INTERNAL_CCTZ)
find_library (LIBRARY_CCTZ cctz) SET(LIBRARY_DIR ${ClickHouse_SOURCE_DIR}/contrib/cctz)
find_path (INCLUDE_CCTZ NAMES cctz/civil_time.h)
if (LIBRARY_CCTZ AND INCLUDE_CCTZ) SET (SRCS
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
@ -651,6 +618,29 @@ if (NOT EXTERNAL_CCTZ_LIBRARY_FOUND OR NOT EXTERNAL_CCTZ_LIBRARY_WORKS)
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,23 +1,9 @@
option (ENABLE_CURL "Enable curl" ${ENABLE_LIBRARIES}) option (ENABLE_CURL "Enable curl" ${ENABLE_LIBRARIES})
if (NOT ENABLE_CURL) if (ENABLE_CURL)
if (USE_INTERNAL_CURL)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't use internal curl with ENABLE_CURL=OFF")
endif()
return()
endif()
option (USE_INTERNAL_CURL "Use internal curl library" ${NOT_UNBUNDLED}) option (USE_INTERNAL_CURL "Use internal curl library" ${NOT_UNBUNDLED})
if (NOT USE_INTERNAL_CURL) if (USE_INTERNAL_CURL)
find_package (CURL)
if (NOT CURL_FOUND)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find system curl")
endif()
endif()
if (NOT CURL_FOUND)
set (USE_INTERNAL_CURL 1)
set (LIBRARY_DIR "${ClickHouse_SOURCE_DIR}/contrib/curl") set (LIBRARY_DIR "${ClickHouse_SOURCE_DIR}/contrib/curl")
set (SRCS set (SRCS
@ -193,8 +179,9 @@ if (NOT CURL_FOUND)
set (CURL_LIBRARIES ${CURL_LIBRARY} CACHE STRING "") set (CURL_LIBRARIES ${CURL_LIBRARY} CACHE STRING "")
set (CURL_VERSION_STRING 7.67.0 CACHE STRING "") set (CURL_VERSION_STRING 7.67.0 CACHE STRING "")
add_library (CURL::libcurl ALIAS ${CURL_LIBRARY}) add_library (CURL::libcurl ALIAS ${CURL_LIBRARY})
else ()
set (USE_INTERNAL_CURL 1) find_package (CURL REQUIRED)
endif ()
endif () endif ()
message (STATUS "Using curl: ${CURL_INCLUDE_DIRS} : ${CURL_LIBRARIES}") message (STATUS "Using curl: ${CURL_INCLUDE_DIRS} : ${CURL_LIBRARIES}")

View File

@ -1,45 +1,13 @@
if (HAVE_SSSE3)
option (ENABLE_HYPERSCAN "Enable hyperscan library" ${ENABLE_LIBRARIES}) option (ENABLE_HYPERSCAN "Enable hyperscan library" ${ENABLE_LIBRARIES})
elseif(ENABLE_HYPERSCAN)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't use hyperscan without SSSE3") if (NOT HAVE_SSSE3)
set (ENABLE_HYPERSCAN OFF) set (ENABLE_HYPERSCAN OFF)
endif () endif ()
if (NOT ENABLE_HYPERSCAN) if (ENABLE_HYPERSCAN)
if (USE_INTERNAL_HYPERSCAN_LIBRARY)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't use internal hyperscan with ENABLE_HYPERSCAN=OFF")
endif()
add_library (hyperscan INTERFACE)
target_compile_definitions (hyperscan INTERFACE USE_HYPERSCAN=0)
message (STATUS "Not using hyperscan")
return()
endif()
option (USE_INTERNAL_HYPERSCAN_LIBRARY "Use internal hyperscan library" ${NOT_UNBUNDLED}) option (USE_INTERNAL_HYPERSCAN_LIBRARY "Use internal hyperscan library" ${NOT_UNBUNDLED})
if (NOT USE_INTERNAL_HYPERSCAN_LIBRARY) if (USE_INTERNAL_HYPERSCAN_LIBRARY)
find_library (LIBRARY_HYPERSCAN hs)
find_path (INCLUDE_HYPERSCAN NAMES hs.h HINTS /usr/include/hs) # Ubuntu puts headers in this folder
if (LIBRARY_HYPERSCAN AND INCLUDE_HYPERSCAN)
set (EXTERNAL_HYPERSCAN_LIBRARY_FOUND 1)
add_library (hyperscan UNKNOWN IMPORTED GLOBAL)
set_target_properties (hyperscan PROPERTIES IMPORTED_LOCATION ${LIBRARY_HYPERSCAN})
set_target_properties (hyperscan PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${INCLUDE_HYPERSCAN})
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 ()
if (NOT EXTERNAL_HYPERSCAN_LIBRARY_FOUND)
set (USE_INTERNAL_HYPERSCAN_LIBRARY 1)
set (LIBRARY_DIR ${ClickHouse_SOURCE_DIR}/contrib/hyperscan) set (LIBRARY_DIR ${ClickHouse_SOURCE_DIR}/contrib/hyperscan)
set (SRCS set (SRCS
@ -265,8 +233,20 @@ if (NOT EXTERNAL_HYPERSCAN_LIBRARY_FOUND)
target_include_directories (hyperscan PRIVATE x86_64) target_include_directories (hyperscan PRIVATE x86_64)
endif () endif ()
target_link_libraries (hyperscan PRIVATE boost::headers_only) 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
set (USE_INTERNAL_HYPERSCAN_LIBRARY 1) add_library (hyperscan UNKNOWN IMPORTED GLOBAL)
set_target_properties (hyperscan PROPERTIES IMPORTED_LOCATION ${LIBRARY_HYPERSCAN})
set_target_properties (hyperscan PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${INCLUDE_HYPERSCAN})
set_property(TARGET hyperscan APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS USE_HYPERSCAN=1)
endif () endif ()
message (STATUS "Using hyperscan") message (STATUS "Using hyperscan")
else ()
add_library (hyperscan INTERFACE)
target_compile_definitions (hyperscan INTERFACE USE_HYPERSCAN=0)
message (STATUS "Not using hyperscan")
endif ()

View File

@ -2,69 +2,17 @@ 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 (${RECONFIGURE_MESSAGE_LEVEL} 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.")
"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 ()
if (NOT ENABLE_JEMALLOC)
if(USE_INTERNAL_JEMALLOC_LIBRARY)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't use internal jemalloc with ENABLE_JEMALLOC=OFF")
endif()
add_library(jemalloc INTERFACE)
target_compile_definitions(jemalloc INTERFACE USE_JEMALLOC=0)
message (STATUS "Not using jemalloc")
return()
endif () endif ()
if (ENABLE_JEMALLOC)
if (NOT OS_LINUX) if (NOT OS_LINUX)
message (WARNING "jemalloc support on non-linux is EXPERIMENTAL") message (WARNING "jemalloc support on non-linux is EXPERIMENTAL")
endif() endif()
option (USE_INTERNAL_JEMALLOC_LIBRARY "Use internal jemalloc library" ${NOT_UNBUNDLED}) option (USE_INTERNAL_JEMALLOC "Use internal jemalloc library" ${NOT_UNBUNDLED})
if (NOT USE_INTERNAL_JEMALLOC_LIBRARY)
find_library(LIBRARY_JEMALLOC jemalloc)
find_path(INCLUDE_JEMALLOC jemalloc/jemalloc.h)
if (LIBRARY_JEMALLOC AND INCLUDE_JEMALLOC)
set(EXTERNAL_JEMALLOC_LIBRARY_FOUND 1)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads)
set (CMAKE_REQUIRED_LIBRARIES ${LIBRARY_JEMALLOC} Threads::Threads "dl")
set (CMAKE_REQUIRED_INCLUDES ${INCLUDE_JEMALLOC})
check_cxx_source_compiles (
"
#include <jemalloc/jemalloc.h>
int main() {
free(mallocx(1, 0));
}
"
EXTERNAL_JEMALLOC_LIBRARY_WORKS
)
if (EXTERNAL_JEMALLOC_LIBRARY_WORKS)
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 (USE_INTERNAL_JEMALLOC)
if (OS_LINUX) if (OS_LINUX)
# ThreadPool select job randomly, and there can be some threads that had been # 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, # performed some memory heavy task before and will be inactive for some time,
@ -145,7 +93,7 @@ if (NOT EXTERNAL_JEMALLOC_LIBRARY_FOUND OR NOT EXTERNAL_JEMALLOC_LIBRARY_WORKS)
elseif (OS_DARWIN) elseif (OS_DARWIN)
set (JEMALLOC_INCLUDE_PREFIX "include_darwin") set (JEMALLOC_INCLUDE_PREFIX "include_darwin")
else () else ()
message (FATAL_ERROR "internal jemalloc: This OS is not supported") message (FATAL_ERROR "This OS is not supported")
endif () endif ()
# ARCH_ # ARCH_
if (ARCH_AMD64) if (ARCH_AMD64)
@ -153,7 +101,7 @@ if (NOT EXTERNAL_JEMALLOC_LIBRARY_FOUND OR NOT EXTERNAL_JEMALLOC_LIBRARY_WORKS)
elseif (ARCH_ARM) elseif (ARCH_ARM)
set(JEMALLOC_INCLUDE_PREFIX "${JEMALLOC_INCLUDE_PREFIX}_aarch64") set(JEMALLOC_INCLUDE_PREFIX "${JEMALLOC_INCLUDE_PREFIX}_aarch64")
else () else ()
message (FATAL_ERROR "internal jemalloc: This arch is not supported") message (FATAL_ERROR "This arch is not supported")
endif () endif ()
configure_file(${JEMALLOC_INCLUDE_PREFIX}/jemalloc/internal/jemalloc_internal_defs.h.in configure_file(${JEMALLOC_INCLUDE_PREFIX}/jemalloc/internal/jemalloc_internal_defs.h.in
@ -175,8 +123,33 @@ if (NOT EXTERNAL_JEMALLOC_LIBRARY_FOUND OR NOT EXTERNAL_JEMALLOC_LIBRARY_WORKS)
target_compile_options(jemalloc PRIVATE -Wno-redundant-decls) target_compile_options(jemalloc PRIVATE -Wno-redundant-decls)
# for RTLD_NEXT # for RTLD_NEXT
target_compile_options(jemalloc PRIVATE -D_GNU_SOURCE) target_compile_options(jemalloc PRIVATE -D_GNU_SOURCE)
else ()
find_library(LIBRARY_JEMALLOC jemalloc)
find_path(INCLUDE_JEMALLOC jemalloc/jemalloc.h)
set (USE_INTERNAL_JEMALLOC_LIBRARY 1) set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
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)
set (CMAKE_REQUIRED_LIBRARIES jemalloc)
check_cxx_source_compiles (
"
#include <jemalloc/jemalloc.h>
int main() {
free(mallocx(1, 0));
}
"
EXTERNAL_JEMALLOC_WORKS
)
if (NOT EXTERNAL_JEMALLOC_WORKS)
message (FATAL_ERROR "jemalloc is unusable: ${LIBRARY_JEMALLOC} ${INCLUDE_JEMALLOC}")
endif ()
endif () endif ()
set_property(TARGET jemalloc APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS USE_JEMALLOC=1) set_property(TARGET jemalloc APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS USE_JEMALLOC=1)
@ -186,3 +159,9 @@ if (MAKE_STATIC_LIBRARIES)
endif() endif()
message (STATUS "Using jemalloc") message (STATUS "Using jemalloc")
else ()
add_library(jemalloc INTERFACE)
target_compile_definitions(jemalloc INTERFACE USE_JEMALLOC=0)
message (STATUS "Not using jemalloc")
endif ()

View File

@ -1,19 +1,11 @@
option (ENABLE_CPUID "Enable libcpuid library (only internal)" ${ENABLE_LIBRARIES}) option (ENABLE_CPUID "Enable libcpuid library (only internal)" ${ENABLE_LIBRARIES})
if (ARCH_ARM AND ENABLE_CPUID) if (ARCH_ARM)
message (${RECONFIGURE_MESSAGE_LEVEL} "cpuid is not supported on ARM")
set (ENABLE_CPUID 0) set (ENABLE_CPUID 0)
endif () endif ()
if (NOT ENABLE_CPUID) if (ENABLE_CPUID)
add_library (cpuid INTERFACE) set (LIBRARY_DIR ${ClickHouse_SOURCE_DIR}/contrib/libcpuid)
target_compile_definitions (cpuid INTERFACE USE_CPUID=0)
return()
endif()
set (LIBRARY_DIR "${ClickHouse_SOURCE_DIR}/contrib/libcpuid")
set (SRCS set (SRCS
${LIBRARY_DIR}/libcpuid/asm-bits.c ${LIBRARY_DIR}/libcpuid/asm-bits.c
@ -36,3 +28,8 @@ if (COMPILER_CLANG)
endif () endif ()
message (STATUS "Using cpuid") message (STATUS "Using cpuid")
else ()
add_library (cpuid INTERFACE)
target_compile_definitions (cpuid INTERFACE USE_CPUID=0)
endif ()

View File

@ -1,12 +1,4 @@
option(PROTOBUF_OLD_ABI_COMPAT "Set to ON for compatiability with external protobuf which was compiled old C++ ABI" ON) if (NOT USE_INTERNAL_PROTOBUF_LIBRARY)
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 "")
@ -15,7 +7,7 @@ if (NOT USE_INTERNAL_PROTOBUF_LIBRARY AND PROTOBUF_OLD_ABI_COMPAT)
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,30 +1,13 @@
option (USE_INTERNAL_LZ4_LIBRARY "Use internal lz4 library" ${NOT_UNBUNDLED}) option (USE_INTERNAL_LZ4_LIBRARY "Use internal lz4 library" ${NOT_UNBUNDLED})
if (NOT USE_INTERNAL_LZ4_LIBRARY) if (USE_INTERNAL_LZ4_LIBRARY)
find_library (LIBRARY_LZ4 lz4) set (LIBRARY_DIR ${ClickHouse_SOURCE_DIR}/contrib/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})
@ -34,4 +17,12 @@ if (NOT EXTERNAL_LZ4_LIBRARY_FOUND)
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,9 +4,6 @@ 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,51 +1,9 @@
option (ENABLE_REPLXX "Enable replxx support" ${ENABLE_LIBRARIES}) option (ENABLE_REPLXX "Enable replxx support" ${ENABLE_LIBRARIES})
if (NOT ENABLE_REPLXX) if (ENABLE_REPLXX)
if (USE_INTERNAL_REPLXX_LIBRARY) option (USE_INTERNAL_REPLXX "Use internal replxx library" ${NOT_UNBUNDLED})
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't use internal replxx with ENABLE_REPLXX=OFF")
endif()
add_library(replxx INTERFACE) if (USE_INTERNAL_REPLXX)
target_compile_definitions(replxx INTERFACE USE_REPLXX=0)
message (STATUS "Not using replxx (Beware! Runtime fallback to readline is possible!)")
return()
endif()
option (USE_INTERNAL_REPLXX_LIBRARY "Use internal replxx library" ${NOT_UNBUNDLED})
if (NOT USE_INTERNAL_REPLXX_LIBRARY)
find_library(LIBRARY_REPLXX NAMES replxx replxx-static)
find_path(INCLUDE_REPLXX replxx.hxx)
if (LIBRARY_REPLXX AND INCLUDE_REPLXX)
set(CMAKE_REQUIRED_LIBRARIES ${LIBRARY_REPLXX})
set(CMAKE_REQUIRED_INCLUDES ${INCLUDE_REPLXX})
check_cxx_source_compiles(
"
#include <replxx.hxx>
int main() {
replxx::Replxx rx;
}
"
EXTERNAL_REPLXX_WORKS
)
if (NOT EXTERNAL_REPLXX_WORKS)
message (${RECONFIGURE_MESSAGE_LEVEL} "replxx is unusable: ${LIBRARY_REPLXX} ${INCLUDE_REPLXX}")
else()
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 (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") set (LIBRARY_DIR "${ClickHouse_SOURCE_DIR}/contrib/replxx")
set(SRCS set(SRCS
@ -63,6 +21,28 @@ if (NOT LIBRARY_REPLXX OR NOT INCLUDE_REPLXX OR NOT EXTERNAL_REPLXX_WORKS)
add_library (replxx ${SRCS}) add_library (replxx ${SRCS})
target_include_directories(replxx SYSTEM PUBLIC ${LIBRARY_DIR}/include) 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)
set_property(TARGET replxx PROPERTY IMPORTED_LOCATION ${LIBRARY_REPLXX})
target_include_directories(replxx SYSTEM PUBLIC ${INCLUDE_REPLXX})
set(CMAKE_REQUIRED_LIBRARIES replxx)
check_cxx_source_compiles(
"
#include <replxx.hxx>
int main() {
replxx::Replxx rx;
}
"
EXTERNAL_REPLXX_WORKS
)
if (NOT EXTERNAL_REPLXX_WORKS)
message (FATAL_ERROR "replxx is unusable: ${LIBRARY_REPLXX} ${INCLUDE_REPLXX}")
endif ()
endif () endif ()
if (COMPILER_CLANG) if (COMPILER_CLANG)
@ -72,3 +52,9 @@ endif ()
target_compile_definitions(replxx PUBLIC USE_REPLXX=1) target_compile_definitions(replxx PUBLIC USE_REPLXX=1)
message (STATUS "Using replxx") message (STATUS "Using replxx")
else ()
add_library(replxx INTERFACE)
target_compile_definitions(replxx INTERFACE USE_REPLXX=0)
message (STATUS "Not using replxx (Beware! Runtime fallback to readline is possible!)")
endif ()

View File

@ -1,44 +1,13 @@
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 (NOT ENABLE_ODBC) if (ENABLE_ODBC)
if (USE_INTERNAL_ODBC_LIBRARY)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't use internal ODBC with ENABLE_ODBC=OFF")
endif()
add_library (unixodbc INTERFACE)
target_compile_definitions (unixodbc INTERFACE USE_ODBC=0)
message (STATUS "Not using unixodbc")
return()
endif()
option (USE_INTERNAL_ODBC_LIBRARY "Use internal ODBC library" ${NOT_UNBUNDLED}) option (USE_INTERNAL_ODBC_LIBRARY "Use internal ODBC library" ${NOT_UNBUNDLED})
if (NOT USE_INTERNAL_ODBC_LIBRARY) if (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) set (LIBRARY_DIR ${ClickHouse_SOURCE_DIR}/contrib/unixodbc)
# ltdl # ltdl
@ -329,8 +298,21 @@ if (NOT EXTERNAL_ODBC_LIBRARY_FOUND)
-Wno-reserved-id-macro -Wno-reserved-id-macro
-O2 -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 () endif ()
target_compile_definitions (unixodbc INTERFACE USE_ODBC=1) target_compile_definitions (unixodbc INTERFACE USE_ODBC=1)
message (STATUS "Using unixodbc") message (STATUS "Using unixodbc")
else ()
add_library (unixodbc INTERFACE)
target_compile_definitions (unixodbc INTERFACE USE_ODBC=0)
message (STATUS "Not using unixodbc")
endif ()