2017-09-10 06:51:27 +00:00
|
|
|
|
if (USE_INCLUDE_WHAT_YOU_USE)
|
|
|
|
|
set (CMAKE_CXX_INCLUDE_WHAT_YOU_USE ${IWYU_PATH})
|
|
|
|
|
endif ()
|
|
|
|
|
|
2019-06-30 18:56:53 +00:00
|
|
|
|
if (USE_CLANG_TIDY)
|
2020-03-08 20:17:49 +00:00
|
|
|
|
set (CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_PATH}")
|
2019-06-30 18:56:53 +00:00
|
|
|
|
endif ()
|
|
|
|
|
|
2019-01-11 12:40:19 +00:00
|
|
|
|
if(COMPILER_PIPE)
|
|
|
|
|
set(MAX_COMPILER_MEMORY 2500)
|
2018-12-27 15:23:37 +00:00
|
|
|
|
else()
|
2019-01-11 12:40:19 +00:00
|
|
|
|
set(MAX_COMPILER_MEMORY 1500)
|
|
|
|
|
endif()
|
|
|
|
|
if(MAKE_STATIC_LIBRARIES)
|
|
|
|
|
set(MAX_LINKER_MEMORY 3500)
|
|
|
|
|
else()
|
|
|
|
|
set(MAX_LINKER_MEMORY 2500)
|
|
|
|
|
endif()
|
|
|
|
|
include(../cmake/limit_jobs.cmake)
|
2018-12-27 15:23:37 +00:00
|
|
|
|
|
2021-04-24 19:47:52 +00:00
|
|
|
|
set (CONFIG_VERSION "${CMAKE_CURRENT_BINARY_DIR}/Common/config_version.h")
|
|
|
|
|
set (CONFIG_COMMON "${CMAKE_CURRENT_BINARY_DIR}/Common/config.h")
|
2017-03-14 13:47:39 +00:00
|
|
|
|
|
2020-04-02 00:36:53 +00:00
|
|
|
|
include (../cmake/version.cmake)
|
2019-04-03 14:06:59 +00:00
|
|
|
|
message (STATUS "Will build ${VERSION_FULL} revision ${VERSION_REVISION} ${VERSION_OFFICIAL}")
|
2020-04-01 23:51:21 +00:00
|
|
|
|
configure_file (Common/config.h.in ${CONFIG_COMMON})
|
|
|
|
|
configure_file (Common/config_version.h.in ${CONFIG_VERSION})
|
2021-04-24 19:47:52 +00:00
|
|
|
|
configure_file (Core/config_core.h.in "${CMAKE_CURRENT_BINARY_DIR}/Core/include/config_core.h")
|
2017-03-14 13:47:39 +00:00
|
|
|
|
|
2021-03-31 10:28:58 +00:00
|
|
|
|
if (USE_DEBUG_HELPERS)
|
2021-04-24 19:47:52 +00:00
|
|
|
|
set (INCLUDE_DEBUG_HELPERS "-I\"${ClickHouse_SOURCE_DIR}/base\" -include \"${ClickHouse_SOURCE_DIR}/src/Core/iostream_debug_helpers.h\"")
|
2021-03-31 10:28:58 +00:00
|
|
|
|
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${INCLUDE_DEBUG_HELPERS}")
|
|
|
|
|
endif ()
|
|
|
|
|
|
2020-01-10 10:25:14 +00:00
|
|
|
|
if (COMPILER_GCC)
|
2018-09-03 17:45:52 +00:00
|
|
|
|
# If we leave this optimization enabled, gcc-7 replaces a pair of SSE intrinsics (16 byte load, store) with a call to memcpy.
|
|
|
|
|
# It leads to slow code. This is compiler bug. It looks like this:
|
|
|
|
|
#
|
|
|
|
|
# (gdb) bt
|
|
|
|
|
#0 memcpy (destination=0x7faa6e9f1638, source=0x7faa81d9e9a8, size=16) at ../libs/libmemcpy/memcpy.h:11
|
|
|
|
|
#1 0x0000000005341c5f in _mm_storeu_si128 (__B=..., __P=<optimized out>) at /usr/lib/gcc/x86_64-linux-gnu/7/include/emmintrin.h:720
|
2020-04-03 15:14:31 +00:00
|
|
|
|
#2 memcpySmallAllowReadWriteOverflow15Impl (n=<optimized out>, src=<optimized out>, dst=<optimized out>) at ../src/Common/memcpySmall.h:37
|
2018-09-03 17:45:52 +00:00
|
|
|
|
|
|
|
|
|
add_definitions ("-fno-tree-loop-distribute-patterns")
|
|
|
|
|
endif ()
|
|
|
|
|
|
2020-04-01 23:51:21 +00:00
|
|
|
|
add_subdirectory (Access)
|
2021-08-18 22:19:14 +00:00
|
|
|
|
add_subdirectory (Backups)
|
2020-04-01 23:51:21 +00:00
|
|
|
|
add_subdirectory (Columns)
|
|
|
|
|
add_subdirectory (Common)
|
|
|
|
|
add_subdirectory (Core)
|
2021-10-15 20:18:20 +00:00
|
|
|
|
add_subdirectory (QueryPipeline)
|
2020-04-01 23:51:21 +00:00
|
|
|
|
add_subdirectory (DataTypes)
|
|
|
|
|
add_subdirectory (Dictionaries)
|
|
|
|
|
add_subdirectory (Disks)
|
|
|
|
|
add_subdirectory (Storages)
|
|
|
|
|
add_subdirectory (Parsers)
|
|
|
|
|
add_subdirectory (IO)
|
|
|
|
|
add_subdirectory (Functions)
|
|
|
|
|
add_subdirectory (Interpreters)
|
|
|
|
|
add_subdirectory (AggregateFunctions)
|
|
|
|
|
add_subdirectory (Client)
|
|
|
|
|
add_subdirectory (TableFunctions)
|
|
|
|
|
add_subdirectory (Processors)
|
|
|
|
|
add_subdirectory (Formats)
|
|
|
|
|
add_subdirectory (Compression)
|
2020-05-27 17:52:52 +00:00
|
|
|
|
add_subdirectory (Server)
|
2021-01-13 10:32:20 +00:00
|
|
|
|
add_subdirectory (Coordination)
|
2020-04-01 23:51:21 +00:00
|
|
|
|
|
2016-12-07 14:58:31 +00:00
|
|
|
|
|
2016-12-06 20:55:13 +00:00
|
|
|
|
set(dbms_headers)
|
|
|
|
|
set(dbms_sources)
|
2016-12-07 14:58:31 +00:00
|
|
|
|
|
2020-04-01 23:51:21 +00:00
|
|
|
|
add_headers_and_sources(clickhouse_common_io Common)
|
|
|
|
|
add_headers_and_sources(clickhouse_common_io Common/HashTable)
|
|
|
|
|
add_headers_and_sources(clickhouse_common_io IO)
|
2020-09-18 23:04:36 +00:00
|
|
|
|
add_headers_and_sources(clickhouse_common_io IO/S3)
|
2020-04-01 23:51:21 +00:00
|
|
|
|
list (REMOVE_ITEM clickhouse_common_io_sources Common/malloc.cpp Common/new_delete.cpp)
|
2017-11-17 19:19:49 +00:00
|
|
|
|
|
2021-10-19 17:41:52 +00:00
|
|
|
|
add_headers_and_sources(dbms Disks/IO)
|
2021-07-09 14:22:53 +00:00
|
|
|
|
if (USE_SQLITE)
|
|
|
|
|
add_headers_and_sources(dbms Databases/SQLite)
|
|
|
|
|
endif()
|
2021-05-17 11:02:35 +00:00
|
|
|
|
|
2019-07-03 16:53:20 +00:00
|
|
|
|
if(USE_RDKAFKA)
|
2020-04-01 23:51:21 +00:00
|
|
|
|
add_headers_and_sources(dbms Storages/Kafka)
|
2019-07-03 16:53:20 +00:00
|
|
|
|
endif()
|
|
|
|
|
|
2020-05-20 04:28:55 +00:00
|
|
|
|
if (USE_AMQPCPP)
|
|
|
|
|
add_headers_and_sources(dbms Storages/RabbitMQ)
|
|
|
|
|
endif()
|
|
|
|
|
|
2020-12-21 19:20:56 +00:00
|
|
|
|
if (USE_LIBPQXX)
|
2021-04-08 12:43:02 +00:00
|
|
|
|
add_headers_and_sources(dbms Core/PostgreSQL)
|
2020-12-21 19:20:56 +00:00
|
|
|
|
add_headers_and_sources(dbms Databases/PostgreSQL)
|
2021-01-15 21:23:58 +00:00
|
|
|
|
add_headers_and_sources(dbms Storages/PostgreSQL)
|
2020-12-21 19:20:56 +00:00
|
|
|
|
endif()
|
|
|
|
|
|
2020-09-02 09:13:59 +00:00
|
|
|
|
if (USE_ROCKSDB)
|
2020-11-08 15:41:16 +00:00
|
|
|
|
add_headers_and_sources(dbms Storages/RocksDB)
|
2020-09-02 09:13:59 +00:00
|
|
|
|
endif()
|
|
|
|
|
|
2020-04-28 15:28:31 +00:00
|
|
|
|
if (USE_AWS_S3)
|
2020-05-27 15:02:25 +00:00
|
|
|
|
add_headers_and_sources(dbms Common/S3)
|
2020-04-28 15:28:31 +00:00
|
|
|
|
add_headers_and_sources(dbms Disks/S3)
|
|
|
|
|
endif()
|
2019-07-03 16:53:20 +00:00
|
|
|
|
|
2020-10-30 19:40:16 +00:00
|
|
|
|
if (USE_HDFS)
|
|
|
|
|
add_headers_and_sources(dbms Storages/HDFS)
|
2021-04-01 22:50:18 +00:00
|
|
|
|
add_headers_and_sources(dbms Disks/HDFS)
|
2021-11-09 12:20:45 +00:00
|
|
|
|
|
|
|
|
|
if (USE_ORC AND USE_PARQUET)
|
|
|
|
|
add_headers_and_sources(dbms Storages/Hive)
|
|
|
|
|
endif()
|
2020-10-30 19:40:16 +00:00
|
|
|
|
endif()
|
|
|
|
|
|
2021-07-03 17:14:56 +00:00
|
|
|
|
if(USE_FILELOG)
|
|
|
|
|
add_headers_and_sources(dbms Storages/FileLog)
|
|
|
|
|
endif()
|
2021-06-09 02:03:36 +00:00
|
|
|
|
|
2017-11-21 19:17:24 +00:00
|
|
|
|
list (APPEND clickhouse_common_io_sources ${CONFIG_BUILD})
|
|
|
|
|
list (APPEND clickhouse_common_io_headers ${CONFIG_VERSION} ${CONFIG_COMMON})
|
2017-03-14 13:47:39 +00:00
|
|
|
|
|
2021-02-17 19:19:39 +00:00
|
|
|
|
list (APPEND dbms_sources Functions/IFunction.cpp Functions/FunctionFactory.cpp Functions/FunctionHelpers.cpp Functions/extractTimeZoneFromFunctionArguments.cpp Functions/replicate.cpp Functions/FunctionsLogical.cpp)
|
2021-05-17 07:30:42 +00:00
|
|
|
|
list (APPEND dbms_headers Functions/IFunction.h Functions/FunctionFactory.h Functions/FunctionHelpers.h Functions/extractTimeZoneFromFunctionArguments.h Functions/replicate.h Functions/FunctionsLogical.h)
|
2017-06-10 09:04:31 +00:00
|
|
|
|
|
2017-05-05 20:39:25 +00:00
|
|
|
|
list (APPEND dbms_sources
|
2021-06-06 21:49:55 +00:00
|
|
|
|
AggregateFunctions/IAggregateFunction.cpp
|
2020-04-01 23:51:21 +00:00
|
|
|
|
AggregateFunctions/AggregateFunctionFactory.cpp
|
|
|
|
|
AggregateFunctions/AggregateFunctionCombinatorFactory.cpp
|
|
|
|
|
AggregateFunctions/AggregateFunctionState.cpp
|
2020-06-18 08:21:01 +00:00
|
|
|
|
AggregateFunctions/AggregateFunctionCount.cpp
|
2020-04-01 23:51:21 +00:00
|
|
|
|
AggregateFunctions/parseAggregateFunctionParameters.cpp)
|
2017-05-05 20:39:25 +00:00
|
|
|
|
|
|
|
|
|
list (APPEND dbms_headers
|
2020-04-01 23:51:21 +00:00
|
|
|
|
AggregateFunctions/IAggregateFunction.h
|
|
|
|
|
AggregateFunctions/IAggregateFunctionCombinator.h
|
|
|
|
|
AggregateFunctions/AggregateFunctionFactory.h
|
|
|
|
|
AggregateFunctions/AggregateFunctionCombinatorFactory.h
|
|
|
|
|
AggregateFunctions/AggregateFunctionState.h
|
2020-06-18 08:21:01 +00:00
|
|
|
|
AggregateFunctions/AggregateFunctionCount.cpp
|
2020-04-01 23:51:21 +00:00
|
|
|
|
AggregateFunctions/FactoryHelpers.h
|
|
|
|
|
AggregateFunctions/parseAggregateFunctionParameters.h)
|
|
|
|
|
|
|
|
|
|
list (APPEND dbms_sources TableFunctions/ITableFunction.cpp TableFunctions/TableFunctionFactory.cpp)
|
|
|
|
|
list (APPEND dbms_headers TableFunctions/ITableFunction.h TableFunctions/TableFunctionFactory.h)
|
|
|
|
|
list (APPEND dbms_sources Dictionaries/DictionaryFactory.cpp Dictionaries/DictionarySourceFactory.cpp Dictionaries/DictionaryStructure.cpp Dictionaries/getDictionaryConfigurationFromAST.cpp)
|
|
|
|
|
list (APPEND dbms_headers Dictionaries/DictionaryFactory.h Dictionaries/DictionarySourceFactory.h Dictionaries/DictionaryStructure.h Dictionaries/getDictionaryConfigurationFromAST.h)
|
2017-05-05 20:39:25 +00:00
|
|
|
|
|
2019-09-15 10:35:12 +00:00
|
|
|
|
if (NOT ENABLE_SSL)
|
2020-04-01 23:51:21 +00:00
|
|
|
|
list (REMOVE_ITEM clickhouse_common_io_sources Common/OpenSSLHelpers.cpp)
|
|
|
|
|
list (REMOVE_ITEM clickhouse_common_io_headers Common/OpenSSLHelpers.h)
|
2019-09-15 10:35:12 +00:00
|
|
|
|
endif ()
|
|
|
|
|
|
2019-04-24 09:06:28 +00:00
|
|
|
|
add_library(clickhouse_common_io ${clickhouse_common_io_headers} ${clickhouse_common_io_sources})
|
2017-11-17 19:19:49 +00:00
|
|
|
|
|
2020-09-14 18:00:45 +00:00
|
|
|
|
if (SPLIT_SHARED_LIBRARIES)
|
|
|
|
|
target_compile_definitions(clickhouse_common_io PRIVATE SPLIT_SHARED_LIBRARIES)
|
|
|
|
|
endif ()
|
|
|
|
|
|
2020-04-01 23:51:21 +00:00
|
|
|
|
add_library (clickhouse_malloc OBJECT Common/malloc.cpp)
|
|
|
|
|
set_source_files_properties(Common/malloc.cpp PROPERTIES COMPILE_FLAGS "-fno-builtin")
|
2019-12-05 11:22:43 +00:00
|
|
|
|
|
2020-12-15 19:59:07 +00:00
|
|
|
|
if (((SANITIZE STREQUAL "thread") OR (SANITIZE STREQUAL "address")) AND COMPILER_GCC)
|
|
|
|
|
message(WARNING "Memory tracking is disabled, due to gcc sanitizers")
|
|
|
|
|
else()
|
|
|
|
|
add_library (clickhouse_new_delete STATIC Common/new_delete.cpp)
|
|
|
|
|
target_link_libraries (clickhouse_new_delete PRIVATE clickhouse_common_io jemalloc)
|
|
|
|
|
endif()
|
2019-09-30 11:58:32 +00:00
|
|
|
|
|
2021-07-21 23:56:17 +00:00
|
|
|
|
target_link_libraries (clickhouse_common_io PRIVATE jemalloc)
|
|
|
|
|
|
2021-10-31 08:51:20 +00:00
|
|
|
|
add_subdirectory(Access/Common)
|
2020-04-01 23:51:21 +00:00
|
|
|
|
add_subdirectory(Common/ZooKeeper)
|
|
|
|
|
add_subdirectory(Common/Config)
|
2018-01-15 19:07:47 +00:00
|
|
|
|
|
2019-08-22 03:24:05 +00:00
|
|
|
|
set (all_modules)
|
|
|
|
|
macro(add_object_library name common_path)
|
|
|
|
|
if (MAKE_STATIC_LIBRARIES OR NOT SPLIT_SHARED_LIBRARIES)
|
2019-10-22 03:54:16 +00:00
|
|
|
|
add_headers_and_sources(dbms ${common_path})
|
2019-08-22 03:24:05 +00:00
|
|
|
|
else ()
|
2019-09-11 02:53:56 +00:00
|
|
|
|
list (APPEND all_modules ${name})
|
2019-10-22 03:54:16 +00:00
|
|
|
|
add_headers_and_sources(${name} ${common_path})
|
2019-08-22 03:24:05 +00:00
|
|
|
|
add_library(${name} SHARED ${${name}_sources} ${${name}_headers})
|
2021-02-07 14:37:50 +00:00
|
|
|
|
if (OS_DARWIN)
|
|
|
|
|
target_link_libraries (${name} PRIVATE -Wl,-undefined,dynamic_lookup)
|
|
|
|
|
else()
|
|
|
|
|
target_link_libraries (${name} PRIVATE -Wl,--unresolved-symbols=ignore-all)
|
|
|
|
|
endif()
|
2019-08-22 03:24:05 +00:00
|
|
|
|
endif ()
|
|
|
|
|
endmacro()
|
|
|
|
|
|
2020-04-01 23:51:21 +00:00
|
|
|
|
add_object_library(clickhouse_access Access)
|
2021-08-18 22:19:14 +00:00
|
|
|
|
add_object_library(clickhouse_backups Backups)
|
2020-04-01 23:51:21 +00:00
|
|
|
|
add_object_library(clickhouse_core Core)
|
2020-08-13 05:02:16 +00:00
|
|
|
|
add_object_library(clickhouse_core_mysql Core/MySQL)
|
2020-04-01 23:51:21 +00:00
|
|
|
|
add_object_library(clickhouse_compression Compression)
|
2021-10-15 20:18:20 +00:00
|
|
|
|
add_object_library(clickhouse_querypipeline QueryPipeline)
|
2020-04-01 23:51:21 +00:00
|
|
|
|
add_object_library(clickhouse_datatypes DataTypes)
|
2021-03-09 14:46:52 +00:00
|
|
|
|
add_object_library(clickhouse_datatypes_serializations DataTypes/Serializations)
|
2020-04-01 23:51:21 +00:00
|
|
|
|
add_object_library(clickhouse_databases Databases)
|
2020-04-28 18:36:43 +00:00
|
|
|
|
add_object_library(clickhouse_databases_mysql Databases/MySQL)
|
2020-04-01 23:51:21 +00:00
|
|
|
|
add_object_library(clickhouse_disks Disks)
|
|
|
|
|
add_object_library(clickhouse_interpreters Interpreters)
|
2021-10-31 08:51:20 +00:00
|
|
|
|
add_object_library(clickhouse_interpreters_access Interpreters/Access)
|
2020-05-06 06:40:05 +00:00
|
|
|
|
add_object_library(clickhouse_interpreters_mysql Interpreters/MySQL)
|
2020-04-01 23:51:21 +00:00
|
|
|
|
add_object_library(clickhouse_interpreters_clusterproxy Interpreters/ClusterProxy)
|
2021-04-29 11:15:35 +00:00
|
|
|
|
add_object_library(clickhouse_interpreters_jit Interpreters/JIT)
|
2020-04-01 23:51:21 +00:00
|
|
|
|
add_object_library(clickhouse_columns Columns)
|
|
|
|
|
add_object_library(clickhouse_storages Storages)
|
2021-05-15 04:40:43 +00:00
|
|
|
|
add_object_library(clickhouse_storages_mysql Storages/MySQL)
|
2020-04-01 23:51:21 +00:00
|
|
|
|
add_object_library(clickhouse_storages_distributed Storages/Distributed)
|
|
|
|
|
add_object_library(clickhouse_storages_mergetree Storages/MergeTree)
|
|
|
|
|
add_object_library(clickhouse_storages_liveview Storages/LiveView)
|
|
|
|
|
add_object_library(clickhouse_client Client)
|
2021-03-12 21:12:34 +00:00
|
|
|
|
add_object_library(clickhouse_bridge Bridge)
|
2020-05-27 17:52:52 +00:00
|
|
|
|
add_object_library(clickhouse_server Server)
|
2021-02-19 12:51:26 +00:00
|
|
|
|
add_object_library(clickhouse_server_http Server/HTTP)
|
2020-04-01 23:51:21 +00:00
|
|
|
|
add_object_library(clickhouse_formats Formats)
|
|
|
|
|
add_object_library(clickhouse_processors Processors)
|
|
|
|
|
add_object_library(clickhouse_processors_executors Processors/Executors)
|
|
|
|
|
add_object_library(clickhouse_processors_formats Processors/Formats)
|
|
|
|
|
add_object_library(clickhouse_processors_formats_impl Processors/Formats/Impl)
|
|
|
|
|
add_object_library(clickhouse_processors_transforms Processors/Transforms)
|
|
|
|
|
add_object_library(clickhouse_processors_sources Processors/Sources)
|
2021-08-23 10:46:52 +00:00
|
|
|
|
add_object_library(clickhouse_processors_sinks Processors/Sinks)
|
2020-04-12 14:17:34 +00:00
|
|
|
|
add_object_library(clickhouse_processors_merges Processors/Merges)
|
2021-10-15 10:11:57 +00:00
|
|
|
|
add_object_library(clickhouse_processors_ttl Processors/TTL)
|
2020-04-14 09:21:24 +00:00
|
|
|
|
add_object_library(clickhouse_processors_merges_algorithms Processors/Merges/Algorithms)
|
2020-06-05 15:38:03 +00:00
|
|
|
|
add_object_library(clickhouse_processors_queryplan Processors/QueryPlan)
|
2021-01-27 13:57:26 +00:00
|
|
|
|
add_object_library(clickhouse_processors_queryplan_optimizations Processors/QueryPlan/Optimizations)
|
2019-08-22 03:24:05 +00:00
|
|
|
|
|
2021-02-01 13:18:17 +00:00
|
|
|
|
if (USE_NURAFT)
|
|
|
|
|
add_object_library(clickhouse_coordination Coordination)
|
|
|
|
|
endif()
|
2019-08-22 03:24:05 +00:00
|
|
|
|
|
2020-10-20 18:12:02 +00:00
|
|
|
|
set (DBMS_COMMON_LIBRARIES)
|
|
|
|
|
# libgcc_s does not provide an implementation of an atomics library. Instead,
|
|
|
|
|
# GCC’s libatomic library can be used to supply these when using libgcc_s.
|
|
|
|
|
if ((NOT USE_LIBCXX) AND COMPILER_CLANG AND OS_LINUX)
|
|
|
|
|
list (APPEND DBMS_COMMON_LIBRARIES atomic)
|
|
|
|
|
endif()
|
2019-09-17 21:08:20 +00:00
|
|
|
|
|
2019-03-04 17:47:31 +00:00
|
|
|
|
if (MAKE_STATIC_LIBRARIES OR NOT SPLIT_SHARED_LIBRARIES)
|
2019-09-11 02:53:56 +00:00
|
|
|
|
add_library (dbms STATIC ${dbms_headers} ${dbms_sources})
|
2021-07-03 15:48:03 +00:00
|
|
|
|
target_link_libraries (dbms PRIVATE jemalloc libdivide ${DBMS_COMMON_LIBRARIES})
|
2019-09-11 02:53:56 +00:00
|
|
|
|
set (all_modules dbms)
|
2019-08-22 03:24:05 +00:00
|
|
|
|
else()
|
2019-09-11 02:53:56 +00:00
|
|
|
|
add_library (dbms SHARED ${dbms_headers} ${dbms_sources})
|
2020-10-20 18:12:02 +00:00
|
|
|
|
target_link_libraries (dbms PUBLIC ${all_modules} ${DBMS_COMMON_LIBRARIES})
|
2021-07-03 15:48:03 +00:00
|
|
|
|
target_link_libraries (clickhouse_interpreters PRIVATE jemalloc libdivide)
|
2019-09-11 02:53:56 +00:00
|
|
|
|
list (APPEND all_modules dbms)
|
|
|
|
|
# force all split libs to be linked
|
2021-02-07 14:37:50 +00:00
|
|
|
|
if (OS_DARWIN)
|
|
|
|
|
set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-undefined,error")
|
|
|
|
|
else()
|
|
|
|
|
set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-as-needed")
|
|
|
|
|
endif()
|
2017-02-08 18:53:00 +00:00
|
|
|
|
endif ()
|
2019-08-22 03:24:05 +00:00
|
|
|
|
|
|
|
|
|
macro (dbms_target_include_directories)
|
|
|
|
|
foreach (module ${all_modules})
|
|
|
|
|
target_include_directories (${module} ${ARGN})
|
|
|
|
|
endforeach ()
|
|
|
|
|
endmacro ()
|
|
|
|
|
|
|
|
|
|
macro (dbms_target_link_libraries)
|
|
|
|
|
foreach (module ${all_modules})
|
|
|
|
|
target_link_libraries (${module} ${ARGN})
|
|
|
|
|
endforeach ()
|
|
|
|
|
endmacro ()
|
2016-12-06 20:55:13 +00:00
|
|
|
|
|
2021-04-24 19:47:52 +00:00
|
|
|
|
dbms_target_include_directories (PUBLIC "${ClickHouse_SOURCE_DIR}/src" "${ClickHouse_BINARY_DIR}/src")
|
|
|
|
|
target_include_directories (clickhouse_common_io PUBLIC "${ClickHouse_SOURCE_DIR}/src" "${ClickHouse_BINARY_DIR}/src")
|
2020-06-09 10:54:49 +00:00
|
|
|
|
|
Add a JIT interface for row-wise default-nullable functions.
Not actually implemented, though. It does print out some jit-compiled stuff,
but that's about it. For example, this query:
select number from system.numbers where something(cast(number as Float64)) == 4
results in this on server's stderr:
define double @"something(CAST(number, 'Float64'))"(void**, i8*, void*) {
"something(CAST(number, 'Float64'))":
ret double 1.234500e+04
}
(and an exception, because that's what the non-jitted method does.)
As one may notice, this function neither reads the input (first argument;
tuple of arrays) nor writes the output (third argument; array), instead
returning some general nonsense.
In addition, `#if USE_EMBEDDED_COMPILER` doesn't work for some reason,
including LLVM headers requires -Wno-unused-parameter, this probably only
works on LLVM 5.0 due to rampant API instability, and I'm definitely
no expert on CMake. In short, there's still a long way to go.
2018-04-23 22:29:39 +00:00
|
|
|
|
if (USE_EMBEDDED_COMPILER)
|
2021-09-09 19:41:26 +00:00
|
|
|
|
dbms_target_link_libraries (PUBLIC ${REQUIRED_LLVM_LIBRARIES})
|
2019-08-22 03:24:05 +00:00
|
|
|
|
dbms_target_include_directories (SYSTEM BEFORE PUBLIC ${LLVM_INCLUDE_DIRS})
|
Add a JIT interface for row-wise default-nullable functions.
Not actually implemented, though. It does print out some jit-compiled stuff,
but that's about it. For example, this query:
select number from system.numbers where something(cast(number as Float64)) == 4
results in this on server's stderr:
define double @"something(CAST(number, 'Float64'))"(void**, i8*, void*) {
"something(CAST(number, 'Float64'))":
ret double 1.234500e+04
}
(and an exception, because that's what the non-jitted method does.)
As one may notice, this function neither reads the input (first argument;
tuple of arrays) nor writes the output (third argument; array), instead
returning some general nonsense.
In addition, `#if USE_EMBEDDED_COMPILER` doesn't work for some reason,
including LLVM headers requires -Wno-unused-parameter, this probably only
works on LLVM 5.0 due to rampant API instability, and I'm definitely
no expert on CMake. In short, there's still a long way to go.
2018-04-23 22:29:39 +00:00
|
|
|
|
endif ()
|
|
|
|
|
|
2019-08-03 15:43:37 +00:00
|
|
|
|
# Otherwise it will slow down stack traces printing too much.
|
|
|
|
|
set_source_files_properties(
|
2020-04-01 23:51:21 +00:00
|
|
|
|
Common/Elf.cpp
|
|
|
|
|
Common/Dwarf.cpp
|
|
|
|
|
Common/SymbolIndex.cpp
|
2019-08-03 15:43:37 +00:00
|
|
|
|
PROPERTIES COMPILE_FLAGS "-O3 ${WITHOUT_COVERAGE}")
|
|
|
|
|
|
2017-11-21 19:17:24 +00:00
|
|
|
|
target_link_libraries (clickhouse_common_io
|
2018-11-21 19:20:27 +00:00
|
|
|
|
PRIVATE
|
2020-05-08 14:11:19 +00:00
|
|
|
|
string_utils
|
|
|
|
|
widechar_width
|
|
|
|
|
${LINK_LIBRARIES_ONLY_ON_X86_64}
|
2018-11-21 19:20:27 +00:00
|
|
|
|
PUBLIC
|
2020-05-08 14:11:19 +00:00
|
|
|
|
common
|
|
|
|
|
${DOUBLE_CONVERSION_LIBRARIES}
|
2020-12-05 21:32:03 +00:00
|
|
|
|
dragonbox_to_chars
|
2019-05-15 17:19:39 +00:00
|
|
|
|
)
|
|
|
|
|
|
2021-10-13 02:04:21 +00:00
|
|
|
|
# Use X86 AVX2/AVX512 instructions to accelerate filter operations
|
|
|
|
|
set_source_files_properties(
|
|
|
|
|
Columns/ColumnFixedString.cpp
|
|
|
|
|
Columns/ColumnsCommon.cpp
|
|
|
|
|
Columns/ColumnVector.cpp
|
2021-10-25 20:09:09 +00:00
|
|
|
|
Columns/ColumnDecimal.cpp
|
2021-10-13 02:04:21 +00:00
|
|
|
|
PROPERTIES COMPILE_FLAGS "${X86_INTRINSICS_FLAGS}")
|
|
|
|
|
|
2019-05-15 17:19:39 +00:00
|
|
|
|
if(RE2_LIBRARY)
|
|
|
|
|
target_link_libraries(clickhouse_common_io PUBLIC ${RE2_LIBRARY})
|
|
|
|
|
endif()
|
|
|
|
|
if(RE2_ST_LIBRARY)
|
|
|
|
|
target_link_libraries(clickhouse_common_io PUBLIC ${RE2_ST_LIBRARY})
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
target_link_libraries(clickhouse_common_io
|
2018-11-21 19:20:27 +00:00
|
|
|
|
PRIVATE
|
2020-05-08 14:11:19 +00:00
|
|
|
|
${EXECINFO_LIBRARIES}
|
|
|
|
|
cpuid
|
2018-11-21 19:20:27 +00:00
|
|
|
|
PUBLIC
|
2020-06-09 10:54:49 +00:00
|
|
|
|
boost::program_options
|
|
|
|
|
boost::system
|
2020-05-08 14:11:19 +00:00
|
|
|
|
${CITYHASH_LIBRARIES}
|
|
|
|
|
${ZLIB_LIBRARIES}
|
|
|
|
|
pcg_random
|
|
|
|
|
Poco::Foundation
|
2017-11-17 19:19:49 +00:00
|
|
|
|
)
|
|
|
|
|
|
2021-08-11 09:21:39 +00:00
|
|
|
|
# Make dbms depend on roaring instead of clickhouse_common_io so that roaring itself can depend on clickhouse_common_io
|
|
|
|
|
# That way we we can redirect malloc/free functions avoiding circular dependencies
|
|
|
|
|
dbms_target_link_libraries(PUBLIC roaring)
|
2020-07-16 20:32:32 +00:00
|
|
|
|
|
2019-07-03 16:53:20 +00:00
|
|
|
|
if (USE_RDKAFKA)
|
2019-08-22 03:24:05 +00:00
|
|
|
|
dbms_target_link_libraries(PRIVATE ${CPPKAFKA_LIBRARY} ${RDKAFKA_LIBRARY})
|
2019-07-03 16:53:20 +00:00
|
|
|
|
if(NOT USE_INTERNAL_RDKAFKA_LIBRARY)
|
2019-08-22 03:24:05 +00:00
|
|
|
|
dbms_target_include_directories(SYSTEM BEFORE PRIVATE ${RDKAFKA_INCLUDE_DIR})
|
2019-07-03 16:53:20 +00:00
|
|
|
|
endif()
|
|
|
|
|
endif()
|
|
|
|
|
|
2020-07-16 20:32:32 +00:00
|
|
|
|
if (USE_CYRUS_SASL)
|
|
|
|
|
dbms_target_link_libraries(PRIVATE ${CYRUS_SASL_LIBRARY})
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
if (USE_KRB5)
|
2021-03-11 20:41:10 +00:00
|
|
|
|
dbms_target_include_directories(SYSTEM BEFORE PRIVATE ${KRB5_INCLUDE_DIR})
|
2020-07-16 20:32:32 +00:00
|
|
|
|
dbms_target_link_libraries(PRIVATE ${KRB5_LIBRARY})
|
|
|
|
|
endif()
|
|
|
|
|
|
2020-12-24 20:10:47 +00:00
|
|
|
|
if (USE_NURAFT)
|
2021-01-13 10:32:20 +00:00
|
|
|
|
dbms_target_link_libraries(PUBLIC ${NURAFT_LIBRARY})
|
2020-12-24 20:10:47 +00:00
|
|
|
|
endif()
|
2020-09-02 09:13:59 +00:00
|
|
|
|
|
2019-05-15 17:19:39 +00:00
|
|
|
|
if(RE2_INCLUDE_DIR)
|
|
|
|
|
target_include_directories(clickhouse_common_io SYSTEM BEFORE PUBLIC ${RE2_INCLUDE_DIR})
|
|
|
|
|
endif()
|
2019-01-31 16:48:37 +00:00
|
|
|
|
|
2019-08-22 03:24:05 +00:00
|
|
|
|
dbms_target_link_libraries (
|
2020-05-08 14:11:19 +00:00
|
|
|
|
PRIVATE
|
2020-06-09 10:54:49 +00:00
|
|
|
|
boost::filesystem
|
|
|
|
|
boost::program_options
|
2020-05-08 14:11:19 +00:00
|
|
|
|
clickhouse_common_config
|
|
|
|
|
clickhouse_common_zookeeper
|
|
|
|
|
clickhouse_dictionaries_embedded
|
2020-06-09 10:54:49 +00:00
|
|
|
|
clickhouse_parsers
|
|
|
|
|
lz4
|
2020-05-08 14:11:19 +00:00
|
|
|
|
Poco::JSON
|
2020-05-26 10:19:59 +00:00
|
|
|
|
Poco::MongoDB
|
2020-05-08 14:11:19 +00:00
|
|
|
|
string_utils
|
|
|
|
|
PUBLIC
|
|
|
|
|
${MYSQLXX_LIBRARY}
|
2020-06-09 10:54:49 +00:00
|
|
|
|
boost::system
|
2020-05-08 14:11:19 +00:00
|
|
|
|
clickhouse_common_io
|
2017-03-28 20:30:57 +00:00
|
|
|
|
)
|
|
|
|
|
|
2021-09-06 15:58:08 +00:00
|
|
|
|
if (NOT_UNBUNDLED)
|
|
|
|
|
dbms_target_link_libraries (
|
|
|
|
|
PUBLIC
|
|
|
|
|
boost::circular_buffer
|
|
|
|
|
boost::heap
|
|
|
|
|
)
|
|
|
|
|
endif()
|
|
|
|
|
|
2021-04-24 19:47:52 +00:00
|
|
|
|
target_include_directories(clickhouse_common_io PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/Core/include") # uses some includes from core
|
|
|
|
|
dbms_target_include_directories(PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/Core/include")
|
2019-08-22 03:24:05 +00:00
|
|
|
|
|
2021-09-30 20:42:50 +00:00
|
|
|
|
target_include_directories(clickhouse_common_io BEFORE PUBLIC ${PDQSORT_INCLUDE_DIR})
|
2019-08-22 03:24:05 +00:00
|
|
|
|
dbms_target_include_directories(SYSTEM BEFORE PUBLIC ${PDQSORT_INCLUDE_DIR})
|
2021-09-30 20:42:50 +00:00
|
|
|
|
target_include_directories(clickhouse_common_io BEFORE PUBLIC ${MINISELECT_INCLUDE_DIR})
|
2020-11-09 17:22:05 +00:00
|
|
|
|
dbms_target_include_directories(SYSTEM BEFORE PUBLIC ${MINISELECT_INCLUDE_DIR})
|
2019-07-09 21:37:43 +00:00
|
|
|
|
|
2019-08-04 00:19:03 +00:00
|
|
|
|
if (ZSTD_LIBRARY)
|
2019-08-22 03:24:05 +00:00
|
|
|
|
dbms_target_link_libraries(PRIVATE ${ZSTD_LIBRARY})
|
2020-11-17 16:02:10 +00:00
|
|
|
|
target_link_libraries (clickhouse_common_io PUBLIC ${ZSTD_LIBRARY})
|
|
|
|
|
target_include_directories (clickhouse_common_io SYSTEM BEFORE PUBLIC ${ZSTD_INCLUDE_DIR})
|
2019-08-22 03:24:05 +00:00
|
|
|
|
if (NOT USE_INTERNAL_ZSTD_LIBRARY AND ZSTD_INCLUDE_DIR)
|
|
|
|
|
dbms_target_include_directories(SYSTEM BEFORE PRIVATE ${ZSTD_INCLUDE_DIR})
|
|
|
|
|
endif ()
|
2019-08-04 00:19:03 +00:00
|
|
|
|
endif()
|
2019-07-09 21:37:43 +00:00
|
|
|
|
|
2021-04-03 22:05:07 +00:00
|
|
|
|
if (XZ_LIBRARY)
|
|
|
|
|
target_link_libraries (clickhouse_common_io PUBLIC ${XZ_LIBRARY})
|
|
|
|
|
target_include_directories (clickhouse_common_io SYSTEM BEFORE PUBLIC ${XZ_INCLUDE_DIR})
|
2020-11-01 18:40:05 +00:00
|
|
|
|
endif()
|
|
|
|
|
|
2017-04-23 19:17:51 +00:00
|
|
|
|
if (USE_ICU)
|
2019-08-22 03:24:05 +00:00
|
|
|
|
dbms_target_link_libraries (PRIVATE ${ICU_LIBRARIES})
|
|
|
|
|
dbms_target_include_directories (SYSTEM PRIVATE ${ICU_INCLUDE_DIRS})
|
2017-04-23 19:17:51 +00:00
|
|
|
|
endif ()
|
|
|
|
|
|
2017-10-04 00:00:22 +00:00
|
|
|
|
if (USE_CAPNP)
|
2019-08-22 03:24:05 +00:00
|
|
|
|
dbms_target_link_libraries (PRIVATE ${CAPNP_LIBRARIES})
|
2018-01-11 18:39:52 +00:00
|
|
|
|
endif ()
|
|
|
|
|
|
2018-10-01 16:44:55 +00:00
|
|
|
|
if (USE_PARQUET)
|
2019-08-22 03:24:05 +00:00
|
|
|
|
dbms_target_link_libraries(PRIVATE ${PARQUET_LIBRARY})
|
2020-11-07 16:49:36 +00:00
|
|
|
|
if (NOT USE_INTERNAL_PARQUET_LIBRARY)
|
2019-08-22 03:24:05 +00:00
|
|
|
|
dbms_target_include_directories (SYSTEM BEFORE PRIVATE ${PARQUET_INCLUDE_DIR} ${ARROW_INCLUDE_DIR})
|
2020-08-16 21:38:31 +00:00
|
|
|
|
if (USE_STATIC_LIBRARIES)
|
|
|
|
|
dbms_target_link_libraries(PRIVATE ${ARROW_LIBRARY})
|
|
|
|
|
endif()
|
2018-10-01 16:44:55 +00:00
|
|
|
|
endif ()
|
|
|
|
|
endif ()
|
2018-05-05 16:21:59 +00:00
|
|
|
|
|
2020-01-08 09:13:12 +00:00
|
|
|
|
if (USE_AVRO)
|
|
|
|
|
dbms_target_link_libraries(PRIVATE ${AVROCPP_LIBRARY})
|
|
|
|
|
dbms_target_include_directories (SYSTEM BEFORE PRIVATE ${AVROCPP_INCLUDE_DIR})
|
|
|
|
|
endif ()
|
|
|
|
|
|
2019-08-22 03:24:05 +00:00
|
|
|
|
if (OPENSSL_CRYPTO_LIBRARY)
|
2019-09-11 02:53:56 +00:00
|
|
|
|
dbms_target_link_libraries (PRIVATE ${OPENSSL_CRYPTO_LIBRARY})
|
|
|
|
|
target_link_libraries (clickhouse_common_io PRIVATE ${OPENSSL_CRYPTO_LIBRARY})
|
2019-03-22 11:18:24 +00:00
|
|
|
|
endif ()
|
2017-02-22 14:34:36 +00:00
|
|
|
|
|
2020-05-12 19:19:15 +00:00
|
|
|
|
if (USE_LDAP)
|
2020-05-29 10:00:12 +00:00
|
|
|
|
dbms_target_include_directories (SYSTEM BEFORE PRIVATE ${OPENLDAP_INCLUDE_DIRS})
|
2020-05-12 19:19:15 +00:00
|
|
|
|
dbms_target_link_libraries (PRIVATE ${OPENLDAP_LIBRARIES})
|
|
|
|
|
endif ()
|
2019-09-17 21:08:20 +00:00
|
|
|
|
dbms_target_include_directories (SYSTEM BEFORE PRIVATE ${SPARSEHASH_INCLUDE_DIR})
|
2018-12-05 13:24:45 +00:00
|
|
|
|
|
2019-01-25 20:02:03 +00:00
|
|
|
|
if (USE_PROTOBUF)
|
2019-08-22 03:24:05 +00:00
|
|
|
|
dbms_target_link_libraries (PRIVATE ${Protobuf_LIBRARY})
|
|
|
|
|
dbms_target_include_directories (SYSTEM BEFORE PRIVATE ${Protobuf_INCLUDE_DIR})
|
2019-01-25 20:02:03 +00:00
|
|
|
|
endif ()
|
2019-01-23 19:19:23 +00:00
|
|
|
|
|
2020-10-11 02:19:01 +00:00
|
|
|
|
if (USE_GRPC)
|
|
|
|
|
dbms_target_link_libraries (PUBLIC clickhouse_grpc_protos)
|
|
|
|
|
endif()
|
|
|
|
|
|
2018-12-05 13:24:45 +00:00
|
|
|
|
if (USE_HDFS)
|
2020-10-30 19:40:16 +00:00
|
|
|
|
dbms_target_link_libraries(PRIVATE ${HDFS3_LIBRARY})
|
|
|
|
|
dbms_target_include_directories (SYSTEM BEFORE PUBLIC ${HDFS3_INCLUDE_DIR})
|
2021-11-05 11:55:30 +00:00
|
|
|
|
|
2021-11-09 12:20:45 +00:00
|
|
|
|
if (USE_ORC AND USE_PARQUET)
|
|
|
|
|
dbms_target_link_libraries(PRIVATE hivemetastore)
|
2021-11-10 02:53:03 +00:00
|
|
|
|
dbms_target_include_directories(SYSTEM BEFORE PUBLIC ${ClickHouse_SOURCE_DIR}/contrib/hive-metastore)
|
2021-11-09 12:20:45 +00:00
|
|
|
|
endif()
|
2018-12-05 13:24:45 +00:00
|
|
|
|
endif()
|
2017-10-13 20:52:42 +00:00
|
|
|
|
|
2019-12-03 16:23:24 +00:00
|
|
|
|
if (USE_AWS_S3)
|
|
|
|
|
target_link_libraries (clickhouse_common_io PUBLIC ${AWS_S3_LIBRARY})
|
|
|
|
|
target_include_directories (clickhouse_common_io SYSTEM BEFORE PUBLIC ${AWS_S3_CORE_INCLUDE_DIR})
|
|
|
|
|
target_include_directories (clickhouse_common_io SYSTEM BEFORE PUBLIC ${AWS_S3_INCLUDE_DIR})
|
|
|
|
|
endif()
|
|
|
|
|
|
2021-07-06 11:34:33 +00:00
|
|
|
|
if (USE_S2_GEOMETRY)
|
2021-07-06 13:20:52 +00:00
|
|
|
|
dbms_target_link_libraries (PUBLIC ${S2_GEOMETRY_LIBRARY})
|
|
|
|
|
dbms_target_include_directories (SYSTEM BEFORE PUBLIC ${S2_GEOMETRY_INCLUDE_DIR})
|
2021-07-06 11:34:33 +00:00
|
|
|
|
endif()
|
|
|
|
|
|
2019-02-02 13:33:50 +00:00
|
|
|
|
if (USE_BROTLI)
|
|
|
|
|
target_link_libraries (clickhouse_common_io PRIVATE ${BROTLI_LIBRARY})
|
|
|
|
|
target_include_directories (clickhouse_common_io SYSTEM BEFORE PRIVATE ${BROTLI_INCLUDE_DIR})
|
|
|
|
|
endif()
|
|
|
|
|
|
2021-11-05 11:55:30 +00:00
|
|
|
|
if (USE_SNAPPY)
|
2021-11-09 09:10:40 +00:00
|
|
|
|
target_link_libraries (clickhouse_common_io PUBLIC ${SNAPPY_LIBRARY})
|
2021-11-05 11:55:30 +00:00
|
|
|
|
target_include_directories (clickhouse_common_io SYSTEM BEFORE PUBLIC ${SNAPPY_INCLUDE_DIR})
|
|
|
|
|
endif()
|
|
|
|
|
|
2021-04-09 12:47:26 +00:00
|
|
|
|
if (USE_AMQPCPP)
|
2021-04-12 13:00:43 +00:00
|
|
|
|
dbms_target_link_libraries(PUBLIC ${AMQPCPP_LIBRARY})
|
|
|
|
|
dbms_target_include_directories (SYSTEM BEFORE PUBLIC ${AMQPCPP_INCLUDE_DIR})
|
2021-04-09 12:47:26 +00:00
|
|
|
|
endif()
|
|
|
|
|
|
2021-07-09 14:22:53 +00:00
|
|
|
|
if (USE_SQLITE)
|
|
|
|
|
dbms_target_link_libraries(PUBLIC sqlite)
|
|
|
|
|
endif()
|
|
|
|
|
|
2020-05-19 17:48:28 +00:00
|
|
|
|
if (USE_CASSANDRA)
|
2020-05-22 14:19:33 +00:00
|
|
|
|
dbms_target_link_libraries(PUBLIC ${CASSANDRA_LIBRARY})
|
|
|
|
|
dbms_target_include_directories (SYSTEM BEFORE PUBLIC ${CASS_INCLUDE_DIR})
|
2020-05-19 17:48:28 +00:00
|
|
|
|
endif()
|
2019-08-22 03:24:05 +00:00
|
|
|
|
|
2018-06-06 20:21:58 +00:00
|
|
|
|
target_include_directories (clickhouse_common_io SYSTEM BEFORE PUBLIC ${DOUBLE_CONVERSION_INCLUDE_DIR})
|
2017-10-14 00:53:01 +00:00
|
|
|
|
|
2020-07-10 19:08:18 +00:00
|
|
|
|
if (USE_MSGPACK)
|
2020-07-10 18:27:10 +00:00
|
|
|
|
target_include_directories (clickhouse_common_io SYSTEM BEFORE PUBLIC ${MSGPACK_INCLUDE_DIR})
|
|
|
|
|
endif()
|
2020-04-04 14:02:14 +00:00
|
|
|
|
|
2020-12-05 17:09:12 +00:00
|
|
|
|
target_link_libraries (clickhouse_common_io PUBLIC ${FAST_FLOAT_LIBRARY})
|
2020-12-05 16:45:22 +00:00
|
|
|
|
target_include_directories (clickhouse_common_io SYSTEM BEFORE PUBLIC ${FAST_FLOAT_INCLUDE_DIR})
|
2020-11-07 16:48:58 +00:00
|
|
|
|
|
2020-06-26 20:17:28 +00:00
|
|
|
|
if (USE_ORC)
|
2020-07-08 23:49:21 +00:00
|
|
|
|
dbms_target_link_libraries(PUBLIC ${ORC_LIBRARIES})
|
2021-04-24 19:47:52 +00:00
|
|
|
|
dbms_target_include_directories(SYSTEM BEFORE PUBLIC ${ORC_INCLUDE_DIR} "${CMAKE_BINARY_DIR}/contrib/orc/c++/include")
|
2020-06-26 20:17:28 +00:00
|
|
|
|
endif ()
|
2020-06-17 19:32:11 +00:00
|
|
|
|
|
2020-09-02 09:13:59 +00:00
|
|
|
|
if (USE_ROCKSDB)
|
|
|
|
|
dbms_target_link_libraries(PUBLIC ${ROCKSDB_LIBRARY})
|
|
|
|
|
dbms_target_include_directories(SYSTEM BEFORE PUBLIC ${ROCKSDB_INCLUDE_DIR})
|
|
|
|
|
endif()
|
|
|
|
|
|
2020-12-10 00:36:31 +00:00
|
|
|
|
if (USE_LIBPQXX)
|
|
|
|
|
dbms_target_link_libraries(PUBLIC ${LIBPQXX_LIBRARY})
|
|
|
|
|
dbms_target_include_directories(SYSTEM BEFORE PUBLIC ${LIBPQXX_INCLUDE_DIR})
|
|
|
|
|
endif()
|
|
|
|
|
|
2021-02-25 16:44:01 +00:00
|
|
|
|
if (USE_DATASKETCHES)
|
|
|
|
|
target_include_directories (clickhouse_aggregate_functions SYSTEM BEFORE PRIVATE ${DATASKETCHES_INCLUDE_DIR})
|
|
|
|
|
endif ()
|
|
|
|
|
|
2021-08-19 10:48:46 +00:00
|
|
|
|
target_link_libraries (clickhouse_common_io PRIVATE lz4)
|
2021-06-17 08:31:37 +00:00
|
|
|
|
|
2020-12-04 12:43:05 +00:00
|
|
|
|
dbms_target_link_libraries(PRIVATE _boost_context)
|
|
|
|
|
|
2021-07-30 13:30:30 +00:00
|
|
|
|
if (USE_NLP)
|
|
|
|
|
dbms_target_link_libraries (PUBLIC stemmer)
|
|
|
|
|
dbms_target_link_libraries (PUBLIC wnb)
|
|
|
|
|
dbms_target_link_libraries (PUBLIC lemmagen)
|
|
|
|
|
endif()
|
2021-06-19 17:57:46 +00:00
|
|
|
|
|
2021-08-06 23:55:04 +00:00
|
|
|
|
if (USE_BZIP2)
|
|
|
|
|
target_link_libraries (clickhouse_common_io PRIVATE ${BZIP2_LIBRARY})
|
|
|
|
|
target_include_directories (clickhouse_common_io SYSTEM BEFORE PRIVATE ${BZIP2_INCLUDE_DIR})
|
|
|
|
|
endif()
|
|
|
|
|
|
2021-04-24 19:47:52 +00:00
|
|
|
|
include ("${ClickHouse_SOURCE_DIR}/cmake/add_check.cmake")
|
2021-03-03 23:11:27 +00:00
|
|
|
|
|
2019-01-25 20:02:03 +00:00
|
|
|
|
if (ENABLE_TESTS AND USE_GTEST)
|
2018-08-26 01:41:08 +00:00
|
|
|
|
macro (grep_gtest_sources BASE_DIR DST_VAR)
|
2018-01-09 17:27:02 +00:00
|
|
|
|
# Cold match files that are not in tests/ directories
|
|
|
|
|
file(GLOB_RECURSE "${DST_VAR}" RELATIVE "${BASE_DIR}" "gtest*.cpp")
|
|
|
|
|
endmacro()
|
|
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
|
# attach all dbms gtest sources
|
2021-04-24 19:47:52 +00:00
|
|
|
|
grep_gtest_sources("${ClickHouse_SOURCE_DIR}/src" dbms_gtest_sources)
|
2017-04-01 07:20:54 +00:00
|
|
|
|
add_executable(unit_tests_dbms ${dbms_gtest_sources})
|
2019-07-08 01:58:15 +00:00
|
|
|
|
|
|
|
|
|
# gtest framework has substandard code
|
2020-01-11 13:09:07 +00:00
|
|
|
|
target_compile_options(unit_tests_dbms PRIVATE
|
|
|
|
|
-Wno-zero-as-null-pointer-constant
|
2021-06-08 23:41:53 +00:00
|
|
|
|
-Wno-covered-switch-default
|
2020-01-11 13:09:07 +00:00
|
|
|
|
-Wno-undef
|
|
|
|
|
-Wno-sign-compare
|
|
|
|
|
-Wno-used-but-marked-unused
|
|
|
|
|
-Wno-missing-noreturn
|
|
|
|
|
-Wno-gnu-zero-variadic-macro-arguments
|
|
|
|
|
)
|
2019-07-08 01:58:15 +00:00
|
|
|
|
|
2021-03-03 22:34:30 +00:00
|
|
|
|
target_link_libraries(unit_tests_dbms PRIVATE
|
|
|
|
|
${GTEST_BOTH_LIBRARIES}
|
|
|
|
|
clickhouse_functions
|
|
|
|
|
clickhouse_aggregate_functions
|
|
|
|
|
clickhouse_parsers
|
|
|
|
|
clickhouse_storages_system
|
|
|
|
|
dbms
|
|
|
|
|
clickhouse_common_zookeeper
|
|
|
|
|
string_utils)
|
|
|
|
|
|
2021-04-09 00:28:24 +00:00
|
|
|
|
# For __udivmodti4 referenced in Core/tests/gtest_DecimalFunctions.cpp
|
|
|
|
|
if (OS_DARWIN AND COMPILER_GCC)
|
|
|
|
|
target_link_libraries(unit_tests_dbms PRIVATE gcc)
|
|
|
|
|
endif ()
|
|
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
|
add_check(unit_tests_dbms)
|
2017-04-10 17:43:30 +00:00
|
|
|
|
endif ()
|