2023-10-29 01:07:24 +00:00
|
|
|
add_compile_options($<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:${COVERAGE_FLAGS}>)
|
|
|
|
|
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()
|
2023-01-03 18:51:10 +00:00
|
|
|
set(MAX_LINKER_MEMORY 3500)
|
2019-01-11 12:40:19 +00:00
|
|
|
include(../cmake/limit_jobs.cmake)
|
2018-12-27 15:23:37 +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}")
|
2022-01-16 10:44:23 +00:00
|
|
|
include (configure_config.cmake)
|
2022-09-28 08:45:15 +00:00
|
|
|
configure_file (Common/config.h.in ${CONFIG_INCLUDE_PATH}/config.h)
|
2023-08-09 03:02:50 +00:00
|
|
|
configure_file (Common/config_version.cpp.in ${CONFIG_INCLUDE_PATH}/config_version.cpp)
|
2017-03-14 13:47:39 +00:00
|
|
|
|
2021-03-31 10:28:58 +00:00
|
|
|
if (USE_DEBUG_HELPERS)
|
2022-01-18 06:48:25 +00:00
|
|
|
get_target_property(MAGIC_ENUM_INCLUDE_DIR ch_contrib::magic_enum INTERFACE_INCLUDE_DIRECTORIES)
|
2022-01-17 04:33:47 +00:00
|
|
|
# CMake generator expression will do insane quoting when it encounters special character like quotes, spaces, etc.
|
|
|
|
# Prefixing "SHELL:" will force it to use the original text.
|
|
|
|
set (INCLUDE_DEBUG_HELPERS "SHELL:-I\"${ClickHouse_SOURCE_DIR}/base\" -I\"${MAGIC_ENUM_INCLUDE_DIR}\" -include \"${ClickHouse_SOURCE_DIR}/src/Core/iostream_debug_helpers.h\"")
|
|
|
|
# Use generator expression as we don't want to pollute CMAKE_CXX_FLAGS, which will interfere with CMake check system.
|
|
|
|
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:${INCLUDE_DEBUG_HELPERS}>)
|
2021-03-31 10:28:58 +00:00
|
|
|
endif ()
|
|
|
|
|
2022-04-04 12:07:05 +00:00
|
|
|
# ClickHouse developers may use platform-dependent code under some macro (e.g. `#ifdef ENABLE_MULTITARGET`).
|
|
|
|
# If turned ON, this option defines such macro.
|
|
|
|
# See `src/Common/TargetSpecific.h`
|
|
|
|
option(ENABLE_MULTITARGET_CODE "Enable platform-dependent code" ON)
|
|
|
|
|
2022-09-07 10:01:51 +00:00
|
|
|
if (NO_SSE3_OR_HIGHER)
|
|
|
|
# Optimized x86 code in DECLARE_*_SPECIFIC_CODE blocks (see `src/Common/TargetSpecific.h`) is sometimes marked FORCE_INLINE. As a
|
|
|
|
# result, its instruction set requirements (e.g. SSE4.2) leak into generic code. This is normally not a problem for standard x86 builds
|
|
|
|
# because generic code is compiled with SSE 4.2 anyways. But it breaks SSE2-only builds. Therefore disabling the multitarget code
|
|
|
|
# machinery and always use generic code. (The cleaner alternative is removing FORCE_INLINE but that impacts performance too much.)
|
|
|
|
set(ENABLE_MULTITARGET_CODE OFF)
|
|
|
|
endif()
|
|
|
|
|
2022-04-04 12:07:05 +00:00
|
|
|
if (ENABLE_MULTITARGET_CODE)
|
|
|
|
add_definitions(-DENABLE_MULTITARGET_CODE=1)
|
|
|
|
else()
|
|
|
|
add_definitions(-DENABLE_MULTITARGET_CODE=0)
|
|
|
|
endif()
|
|
|
|
|
2023-08-21 03:43:03 +00:00
|
|
|
set(dbms_headers)
|
|
|
|
set(dbms_sources)
|
2022-04-04 12:07:05 +00:00
|
|
|
|
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)
|
2022-07-14 11:20:16 +00:00
|
|
|
add_subdirectory (Analyzer)
|
2022-08-24 09:21:03 +00:00
|
|
|
add_subdirectory (Planner)
|
2020-04-01 23:51:21 +00:00
|
|
|
add_subdirectory (Interpreters)
|
|
|
|
add_subdirectory (AggregateFunctions)
|
|
|
|
add_subdirectory (Client)
|
|
|
|
add_subdirectory (TableFunctions)
|
|
|
|
add_subdirectory (Processors)
|
|
|
|
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)
|
2022-04-27 15:05:45 +00:00
|
|
|
add_subdirectory (Bridge)
|
|
|
|
add_subdirectory (Daemon)
|
|
|
|
add_subdirectory (Loggers)
|
2023-03-13 03:51:50 +00:00
|
|
|
add_subdirectory (Formats)
|
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)
|
2024-01-20 12:06:26 +00:00
|
|
|
add_headers_and_sources(clickhouse_common_io Common/Scheduler)
|
|
|
|
add_headers_and_sources(clickhouse_common_io Common/Scheduler/Nodes)
|
2023-09-26 15:50:19 +00:00
|
|
|
add_headers_and_sources(clickhouse_common_io Common/SSH)
|
2020-04-01 23:51:21 +00:00
|
|
|
add_headers_and_sources(clickhouse_common_io IO)
|
2022-01-28 17:32:35 +00:00
|
|
|
add_headers_and_sources(clickhouse_common_io IO/Archives)
|
2020-09-18 23:04:36 +00:00
|
|
|
add_headers_and_sources(clickhouse_common_io IO/S3)
|
2023-11-20 09:56:10 +00:00
|
|
|
add_headers_and_sources(clickhouse_common_io IO/AzureBlobStorage)
|
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
|
|
|
|
2023-10-17 08:16:07 +00:00
|
|
|
|
|
|
|
add_headers_and_sources(clickhouse_compression Compression)
|
|
|
|
add_headers_and_sources(clickhouse_compression Parsers)
|
|
|
|
add_headers_and_sources(clickhouse_compression Core)
|
2023-10-19 09:59:22 +00:00
|
|
|
#Included these specific files to avoid linking grpc
|
|
|
|
add_glob(clickhouse_compression_headers Server/ServerType.h)
|
|
|
|
add_glob(clickhouse_compression_sources Server/ServerType.cpp)
|
2023-10-17 08:16:07 +00:00
|
|
|
add_headers_and_sources(clickhouse_compression Common/SSH)
|
|
|
|
add_library(clickhouse_compression ${clickhouse_compression_headers} ${clickhouse_compression_sources})
|
|
|
|
|
|
|
|
|
2021-10-19 17:41:52 +00:00
|
|
|
add_headers_and_sources(dbms Disks/IO)
|
2022-05-22 11:51:48 +00:00
|
|
|
add_headers_and_sources(dbms Disks/ObjectStorages)
|
2022-01-17 20:53:49 +00:00
|
|
|
if (TARGET ch_contrib::sqlite)
|
2021-07-09 14:22:53 +00:00
|
|
|
add_headers_and_sources(dbms Databases/SQLite)
|
|
|
|
endif()
|
2021-05-17 11:02:35 +00:00
|
|
|
|
2022-01-17 05:21:56 +00:00
|
|
|
if (TARGET ch_contrib::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()
|
|
|
|
|
2022-05-12 16:11:32 +00:00
|
|
|
if (TARGET ch_contrib::nats_io)
|
|
|
|
add_headers_and_sources(dbms Storages/NATS)
|
|
|
|
endif()
|
2022-05-08 12:12:15 +00:00
|
|
|
|
2023-03-28 19:57:14 +00:00
|
|
|
add_headers_and_sources(dbms Storages/DataLakes)
|
2023-10-16 19:58:03 +00:00
|
|
|
add_headers_and_sources(dbms Storages/DataLakes/Iceberg)
|
2022-12-16 22:57:09 +00:00
|
|
|
add_headers_and_sources(dbms Common/NamedCollections)
|
2021-12-26 09:00:58 +00:00
|
|
|
|
2022-01-17 19:53:36 +00:00
|
|
|
if (TARGET ch_contrib::amqp_cpp)
|
2020-05-20 04:28:55 +00:00
|
|
|
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()
|
|
|
|
|
2022-01-16 10:44:23 +00:00
|
|
|
if (TARGET ch_contrib::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()
|
|
|
|
|
2022-01-18 06:48:23 +00:00
|
|
|
if (TARGET ch_contrib::aws_s3)
|
2020-05-27 15:02:25 +00:00
|
|
|
add_headers_and_sources(dbms Common/S3)
|
2022-05-22 11:51:48 +00:00
|
|
|
add_headers_and_sources(dbms Disks/ObjectStorages/S3)
|
2020-04-28 15:28:31 +00:00
|
|
|
endif()
|
2019-07-03 16:53:20 +00:00
|
|
|
|
2022-01-18 06:48:22 +00:00
|
|
|
if (TARGET ch_contrib::azure_sdk)
|
2022-05-22 11:51:48 +00:00
|
|
|
add_headers_and_sources(dbms Disks/ObjectStorages/AzureBlobStorage)
|
2023-11-20 09:56:10 +00:00
|
|
|
add_headers_and_sources(dbms IO/AzureBlobStorage)
|
2021-09-27 09:31:27 +00:00
|
|
|
endif()
|
|
|
|
|
2022-01-17 18:45:53 +00:00
|
|
|
if (TARGET ch_contrib::hdfs)
|
2020-10-30 19:40:16 +00:00
|
|
|
add_headers_and_sources(dbms Storages/HDFS)
|
2022-05-22 11:51:48 +00:00
|
|
|
add_headers_and_sources(dbms Disks/ObjectStorages/HDFS)
|
2020-10-30 19:40:16 +00:00
|
|
|
endif()
|
|
|
|
|
2022-06-10 10:33:29 +00:00
|
|
|
add_headers_and_sources(dbms Disks/ObjectStorages/Cached)
|
2023-04-14 17:28:04 +00:00
|
|
|
add_headers_and_sources(dbms Disks/ObjectStorages/Local)
|
2022-07-13 22:44:36 +00:00
|
|
|
add_headers_and_sources(dbms Disks/ObjectStorages/Web)
|
2022-06-10 10:33:29 +00:00
|
|
|
|
2021-12-23 03:50:26 +00:00
|
|
|
add_headers_and_sources(dbms Storages/Cache)
|
2022-01-18 19:34:22 +00:00
|
|
|
if (TARGET ch_contrib::hivemetastore)
|
2021-11-22 02:52:10 +00:00
|
|
|
add_headers_and_sources(dbms Storages/Hive)
|
2020-10-30 19:40:16 +00:00
|
|
|
endif()
|
|
|
|
|
2022-01-17 21:38:43 +00:00
|
|
|
if (OS_LINUX)
|
2021-07-03 17:14:56 +00:00
|
|
|
add_headers_and_sources(dbms Storages/FileLog)
|
2022-01-17 21:38:43 +00:00
|
|
|
else()
|
|
|
|
message(STATUS "StorageFileLog is only supported on Linux")
|
|
|
|
endif ()
|
2021-06-09 02:03:36 +00:00
|
|
|
|
2023-08-21 03:43:03 +00:00
|
|
|
list(APPEND clickhouse_common_io_sources ${CONFIG_INCLUDE_PATH}/config_version.cpp)
|
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-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
|
|
|
|
2023-04-11 16:16:26 +00:00
|
|
|
add_library (clickhouse_new_delete STATIC Common/new_delete.cpp)
|
|
|
|
target_link_libraries (clickhouse_new_delete PRIVATE clickhouse_common_io)
|
|
|
|
if (TARGET ch_contrib::jemalloc)
|
|
|
|
target_link_libraries (clickhouse_new_delete PRIVATE ch_contrib::jemalloc)
|
2022-01-18 06:51:13 +00:00
|
|
|
target_link_libraries (clickhouse_common_io PRIVATE ch_contrib::jemalloc)
|
2023-06-30 11:23:23 +00:00
|
|
|
target_link_libraries (clickhouse_storages_system PRIVATE ch_contrib::jemalloc)
|
2022-01-18 06:51:13 +00:00
|
|
|
endif()
|
2023-06-30 11:23:23 +00:00
|
|
|
|
2023-08-22 11:59:59 +00:00
|
|
|
if (TARGET ch_contrib::azure_sdk)
|
|
|
|
target_link_libraries(clickhouse_storages_system PRIVATE ch_contrib::azure_sdk)
|
|
|
|
endif()
|
|
|
|
|
2023-07-23 02:56:47 +00:00
|
|
|
target_link_libraries (clickhouse_common_io PUBLIC ch_contrib::sparsehash ch_contrib::incbin)
|
2021-07-21 23:56:17 +00:00
|
|
|
|
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)
|
2023-01-03 18:35:24 +00:00
|
|
|
add_headers_and_sources(dbms ${common_path})
|
2019-08-22 03:24:05 +00:00
|
|
|
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)
|
2023-01-13 19:28:47 +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)
|
2022-07-14 11:20:16 +00:00
|
|
|
add_object_library(clickhouse_analyzer Analyzer)
|
2022-10-11 14:14:33 +00:00
|
|
|
add_object_library(clickhouse_analyzer_passes Analyzer/Passes)
|
2022-08-24 09:21:03 +00:00
|
|
|
add_object_library(clickhouse_planner Planner)
|
2020-04-01 23:51:21 +00:00
|
|
|
add_object_library(clickhouse_interpreters Interpreters)
|
2022-08-26 17:23:46 +00:00
|
|
|
add_object_library(clickhouse_interpreters_cache Interpreters/Cache)
|
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)
|
2023-11-28 15:32:47 +00:00
|
|
|
add_object_library(clickhouse_storages_statistics Storages/Statistics)
|
2020-04-01 23:51:21 +00:00
|
|
|
add_object_library(clickhouse_storages_liveview Storages/LiveView)
|
2020-04-02 17:14:34 +00:00
|
|
|
add_object_library(clickhouse_storages_windowview Storages/WindowView)
|
2023-04-19 18:15:24 +00:00
|
|
|
add_object_library(clickhouse_storages_s3queue Storages/S3Queue)
|
2023-02-12 19:17:55 +00:00
|
|
|
add_object_library(clickhouse_storages_materializedview Storages/MaterializedView)
|
2020-04-01 23:51:21 +00:00
|
|
|
add_object_library(clickhouse_client Client)
|
2022-04-27 15:05:45 +00:00
|
|
|
add_object_library(clickhouse_bridge BridgeHelper)
|
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)
|
2022-09-24 21:24:39 +00:00
|
|
|
add_object_library(clickhouse_user_defined_functions Functions/UserDefined)
|
2019-08-22 03:24:05 +00:00
|
|
|
|
2023-05-01 01:53:20 +00:00
|
|
|
if (USE_PARQUET)
|
|
|
|
add_object_library(clickhouse_processors_formats_impl_parquet Processors/Formats/Impl/Parquet)
|
|
|
|
endif()
|
|
|
|
|
2022-01-17 18:45:54 +00:00
|
|
|
if (TARGET ch_contrib::nuraft)
|
2021-02-01 13:18:17 +00:00
|
|
|
add_object_library(clickhouse_coordination Coordination)
|
|
|
|
endif()
|
2019-08-22 03:24:05 +00:00
|
|
|
|
2023-01-03 18:35:24 +00:00
|
|
|
add_library (dbms STATIC ${dbms_headers} ${dbms_sources})
|
|
|
|
target_link_libraries (dbms PRIVATE ch_contrib::libdivide)
|
|
|
|
if (TARGET ch_contrib::jemalloc)
|
|
|
|
target_link_libraries (dbms PRIVATE ch_contrib::jemalloc)
|
|
|
|
endif()
|
|
|
|
set (all_modules dbms)
|
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
|
|
|
|
2022-12-10 10:16:31 +00:00
|
|
|
macro (dbms_target_include_directories)
|
|
|
|
foreach (module ${all_modules})
|
|
|
|
target_include_directories (${module} ${ARGN})
|
|
|
|
endforeach ()
|
|
|
|
endmacro ()
|
|
|
|
|
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
|
|
|
|
2022-01-18 06:48:23 +00:00
|
|
|
if (TARGET ch_contrib::llvm)
|
|
|
|
dbms_target_link_libraries (PUBLIC ch_contrib::llvm)
|
2023-10-17 14:10:45 +00:00
|
|
|
target_link_libraries (clickhouse_compression PUBLIC ch_contrib::llvm)
|
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 ()
|
|
|
|
|
2023-01-12 14:00:26 +00:00
|
|
|
if (TARGET ch_contrib::gwp_asan)
|
2023-01-30 16:07:01 +00:00
|
|
|
target_link_libraries (clickhouse_common_io PRIVATE ch_contrib::gwp_asan)
|
2023-01-12 14:00:26 +00:00
|
|
|
target_link_libraries (clickhouse_new_delete PRIVATE ch_contrib::gwp_asan)
|
|
|
|
endif()
|
|
|
|
|
2019-08-03 15:43:37 +00:00
|
|
|
# Otherwise it will slow down stack traces printing too much.
|
2024-01-29 16:34:11 +00:00
|
|
|
if ("${CMAKE_BUILD_TYPE_UC}" STREQUAL "DEBUG")
|
|
|
|
set_source_files_properties(
|
|
|
|
Common/Elf.cpp
|
|
|
|
Common/Dwarf.cpp
|
|
|
|
Common/SymbolIndex.cpp
|
|
|
|
Common/ThreadFuzzer.cpp
|
|
|
|
PROPERTIES COMPILE_FLAGS "-O2 ${WITHOUT_COVERAGE_FLAGS}")
|
|
|
|
endif()
|
2019-08-03 15:43:37 +00:00
|
|
|
|
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
|
2022-01-17 18:45:54 +00:00
|
|
|
ch_contrib::double_conversion
|
2022-01-20 14:16:23 +00:00
|
|
|
ch_contrib::dragonbox_to_chars
|
2023-10-14 11:44:22 +00:00
|
|
|
ch_contrib::libdivide
|
2019-05-15 17:19:39 +00:00
|
|
|
)
|
|
|
|
|
2023-10-17 08:16:07 +00:00
|
|
|
|
|
|
|
target_link_libraries (clickhouse_compression
|
|
|
|
PUBLIC
|
2023-10-17 10:30:11 +00:00
|
|
|
string_utils
|
|
|
|
pcg_random
|
|
|
|
clickhouse_parsers
|
2023-10-17 08:16:07 +00:00
|
|
|
PRIVATE
|
2023-10-17 10:30:11 +00:00
|
|
|
ch_contrib::lz4
|
|
|
|
ch_contrib::roaring
|
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
|
2022-01-17 08:13:49 +00:00
|
|
|
Columns/ColumnString.cpp
|
2021-10-13 02:04:21 +00:00
|
|
|
PROPERTIES COMPILE_FLAGS "${X86_INTRINSICS_FLAGS}")
|
|
|
|
|
2022-07-05 19:28:41 +00:00
|
|
|
if (ENABLE_QPL)
|
2023-04-11 16:16:26 +00:00
|
|
|
set_source_files_properties(
|
|
|
|
Compression/CompressionCodecDeflateQpl.cpp
|
|
|
|
PROPERTIES COMPILE_FLAGS "-mwaitpkg")
|
2022-07-05 19:28:41 +00:00
|
|
|
endif ()
|
|
|
|
|
2019-05-15 17:19:39 +00:00
|
|
|
target_link_libraries(clickhouse_common_io
|
2018-11-21 19:20:27 +00:00
|
|
|
PUBLIC
|
2020-06-09 10:54:49 +00:00
|
|
|
boost::program_options
|
|
|
|
boost::system
|
2023-05-31 09:53:00 +00:00
|
|
|
boost::context
|
2022-01-17 19:09:12 +00:00
|
|
|
ch_contrib::cityhash
|
2023-02-03 10:54:49 +00:00
|
|
|
ch_contrib::re2
|
2022-01-16 10:34:54 +00:00
|
|
|
ch_contrib::zlib
|
2020-05-08 14:11:19 +00:00
|
|
|
pcg_random
|
|
|
|
Poco::Foundation
|
2017-11-17 19:19:49 +00:00
|
|
|
)
|
|
|
|
|
2023-04-25 20:07:04 +00:00
|
|
|
if (TARGET ch_contrib::fiu)
|
|
|
|
target_link_libraries(clickhouse_common_io PUBLIC ch_contrib::fiu)
|
|
|
|
endif()
|
|
|
|
|
2022-01-18 06:51:13 +00:00
|
|
|
if (TARGET ch_contrib::cpuid)
|
|
|
|
target_link_libraries(clickhouse_common_io PRIVATE ch_contrib::cpuid)
|
|
|
|
endif()
|
|
|
|
|
2023-01-11 04:56:16 +00:00
|
|
|
if (TARGET ch_contrib::crc32-vpmsum)
|
|
|
|
target_link_libraries(clickhouse_common_io PUBLIC ch_contrib::crc32-vpmsum)
|
|
|
|
endif()
|
|
|
|
|
2023-09-26 15:50:19 +00:00
|
|
|
if (TARGET ch_contrib::ssh)
|
|
|
|
target_link_libraries(clickhouse_common_io PUBLIC ch_contrib::ssh)
|
2023-10-17 14:10:45 +00:00
|
|
|
target_link_libraries(clickhouse_compression PUBLIC ch_contrib::ssh)
|
2023-09-26 15:50:19 +00:00
|
|
|
endif()
|
|
|
|
|
2022-01-22 19:41:41 +00:00
|
|
|
dbms_target_link_libraries(PUBLIC ch_contrib::abseil_swiss_tables)
|
2022-10-13 19:50:11 +00:00
|
|
|
target_link_libraries (clickhouse_common_io PUBLIC ch_contrib::abseil_swiss_tables)
|
2022-01-21 16:40:24 +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
|
2022-01-20 14:01:49 +00:00
|
|
|
dbms_target_link_libraries(PUBLIC ch_contrib::roaring)
|
2020-07-16 20:32:32 +00:00
|
|
|
|
2022-01-17 05:21:56 +00:00
|
|
|
if (TARGET ch_contrib::rdkafka)
|
2023-06-08 09:42:42 +00:00
|
|
|
dbms_target_link_libraries(PUBLIC ch_contrib::rdkafka ch_contrib::cppkafka)
|
2019-07-03 16:53:20 +00:00
|
|
|
endif()
|
|
|
|
|
2022-05-12 16:11:32 +00:00
|
|
|
if (TARGET ch_contrib::nats_io)
|
2022-07-20 15:27:45 +00:00
|
|
|
dbms_target_link_libraries(PRIVATE ch_contrib::nats_io ch_contrib::uv)
|
2022-05-12 16:11:32 +00:00
|
|
|
endif()
|
2022-05-08 12:12:15 +00:00
|
|
|
|
2022-01-17 21:54:24 +00:00
|
|
|
if (TARGET ch_contrib::sasl2)
|
|
|
|
dbms_target_link_libraries(PRIVATE ch_contrib::sasl2)
|
2020-07-16 20:32:32 +00:00
|
|
|
endif()
|
|
|
|
|
2022-01-17 21:44:15 +00:00
|
|
|
if (TARGET ch_contrib::krb5)
|
|
|
|
dbms_target_link_libraries(PRIVATE ch_contrib::krb5)
|
2023-10-17 14:10:45 +00:00
|
|
|
target_link_libraries (clickhouse_compression PRIVATE ch_contrib::krb5)
|
2020-07-16 20:32:32 +00:00
|
|
|
endif()
|
|
|
|
|
2022-01-17 18:45:54 +00:00
|
|
|
if (TARGET ch_contrib::nuraft)
|
|
|
|
dbms_target_link_libraries(PUBLIC ch_contrib::nuraft)
|
2023-10-17 14:10:45 +00:00
|
|
|
target_link_libraries (clickhouse_compression PUBLIC ch_contrib::nuraft)
|
2019-05-15 17:19:39 +00:00
|
|
|
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
|
2022-01-17 05:28:05 +00:00
|
|
|
ch_contrib::lz4
|
2020-05-08 14:11:19 +00:00
|
|
|
Poco::JSON
|
|
|
|
string_utils
|
|
|
|
PUBLIC
|
2020-06-09 10:54:49 +00:00
|
|
|
boost::system
|
2020-05-08 14:11:19 +00:00
|
|
|
clickhouse_common_io
|
2022-05-14 16:33:06 +00:00
|
|
|
Poco::MongoDB
|
2023-05-17 02:42:52 +00:00
|
|
|
Poco::Redis
|
2017-03-28 20:30:57 +00:00
|
|
|
)
|
|
|
|
|
2022-01-18 06:48:23 +00:00
|
|
|
if (TARGET ch::mysqlxx)
|
|
|
|
dbms_target_link_libraries (PUBLIC ch::mysqlxx)
|
|
|
|
endif()
|
|
|
|
|
2021-11-21 10:58:26 +00:00
|
|
|
dbms_target_link_libraries (
|
|
|
|
PUBLIC
|
|
|
|
boost::circular_buffer
|
|
|
|
boost::heap)
|
2021-09-06 15:58:08 +00:00
|
|
|
|
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
|
|
|
|
2022-01-17 21:37:14 +00:00
|
|
|
target_link_libraries(clickhouse_common_io PUBLIC
|
|
|
|
ch_contrib::miniselect
|
|
|
|
ch_contrib::pdqsort)
|
|
|
|
dbms_target_link_libraries(PUBLIC
|
|
|
|
ch_contrib::miniselect
|
|
|
|
ch_contrib::pdqsort)
|
2019-07-09 21:37:43 +00:00
|
|
|
|
2022-01-16 09:20:20 +00:00
|
|
|
dbms_target_link_libraries(PRIVATE ch_contrib::zstd)
|
|
|
|
target_link_libraries (clickhouse_common_io PUBLIC ch_contrib::zstd)
|
2022-01-18 07:18:46 +00:00
|
|
|
target_link_libraries (clickhouse_common_io PUBLIC ch_contrib::xz)
|
2020-11-01 18:40:05 +00:00
|
|
|
|
2023-11-07 19:56:34 +00:00
|
|
|
if (TARGET ch_contrib::pocketfft)
|
|
|
|
target_link_libraries(clickhouse_common_io PUBLIC ch_contrib::pocketfft)
|
|
|
|
endif ()
|
2023-10-30 18:08:23 +00:00
|
|
|
|
2022-01-17 19:20:39 +00:00
|
|
|
if (TARGET ch_contrib::icu)
|
|
|
|
dbms_target_link_libraries (PRIVATE ch_contrib::icu)
|
2017-04-23 19:17:51 +00:00
|
|
|
endif ()
|
|
|
|
|
2022-01-17 20:57:21 +00:00
|
|
|
if (TARGET ch_contrib::capnp)
|
|
|
|
dbms_target_link_libraries (PRIVATE ch_contrib::capnp)
|
2018-01-11 18:39:52 +00:00
|
|
|
endif ()
|
|
|
|
|
2022-01-16 18:02:32 +00:00
|
|
|
if (TARGET ch_contrib::parquet)
|
|
|
|
dbms_target_link_libraries (PRIVATE ch_contrib::parquet)
|
2018-10-01 16:44:55 +00:00
|
|
|
endif ()
|
2018-05-05 16:21:59 +00:00
|
|
|
|
2022-01-16 19:34:00 +00:00
|
|
|
if (TARGET ch_contrib::avrocpp)
|
|
|
|
dbms_target_link_libraries(PRIVATE ch_contrib::avrocpp)
|
2020-01-08 09:13:12 +00:00
|
|
|
endif ()
|
|
|
|
|
2022-07-12 17:21:10 +00:00
|
|
|
set_source_files_properties(Common/CaresPTRResolver.cpp PROPERTIES COMPILE_FLAGS -Wno-reserved-identifier)
|
2022-07-08 20:52:14 +00:00
|
|
|
target_link_libraries (clickhouse_common_io PRIVATE ch_contrib::c-ares)
|
2022-06-03 01:54:14 +00:00
|
|
|
|
2022-01-17 05:45:10 +00:00
|
|
|
if (TARGET OpenSSL::Crypto)
|
|
|
|
dbms_target_link_libraries (PRIVATE OpenSSL::Crypto)
|
|
|
|
target_link_libraries (clickhouse_common_io PRIVATE OpenSSL::Crypto)
|
2019-03-22 11:18:24 +00:00
|
|
|
endif ()
|
2017-02-22 14:34:36 +00:00
|
|
|
|
2022-01-17 06:00:50 +00:00
|
|
|
if (TARGET ch_contrib::ldap)
|
|
|
|
dbms_target_link_libraries (PRIVATE ch_contrib::ldap ch_contrib::lber)
|
2023-10-17 14:10:45 +00:00
|
|
|
target_link_libraries (clickhouse_compression PRIVATE ch_contrib::ldap ch_contrib::lber)
|
2020-05-12 19:19:15 +00:00
|
|
|
endif ()
|
2023-05-02 12:36:02 +00:00
|
|
|
dbms_target_link_libraries (PUBLIC ch_contrib::sparsehash)
|
2018-12-05 13:24:45 +00:00
|
|
|
|
2022-01-17 07:46:31 +00:00
|
|
|
if (TARGET ch_contrib::protobuf)
|
|
|
|
dbms_target_link_libraries (PRIVATE ch_contrib::protobuf)
|
2019-01-25 20:02:03 +00:00
|
|
|
endif ()
|
2019-01-23 19:19:23 +00:00
|
|
|
|
2022-01-17 07:36:58 +00:00
|
|
|
if (TARGET clickhouse_grpc_protos)
|
2020-10-11 02:19:01 +00:00
|
|
|
dbms_target_link_libraries (PUBLIC clickhouse_grpc_protos)
|
|
|
|
endif()
|
|
|
|
|
2022-01-17 18:45:53 +00:00
|
|
|
if (TARGET ch_contrib::hdfs)
|
|
|
|
dbms_target_link_libraries(PRIVATE ch_contrib::hdfs)
|
2018-12-05 13:24:45 +00:00
|
|
|
endif()
|
2017-10-13 20:52:42 +00:00
|
|
|
|
2022-01-17 05:06:53 +00:00
|
|
|
if (TARGET ch_contrib::hivemetastore)
|
|
|
|
dbms_target_link_libraries(PRIVATE ch_contrib::hivemetastore)
|
2018-12-05 13:24:45 +00:00
|
|
|
endif()
|
2017-10-13 20:52:42 +00:00
|
|
|
|
2021-11-22 02:52:10 +00:00
|
|
|
|
2022-01-18 06:48:23 +00:00
|
|
|
if (TARGET ch_contrib::aws_s3)
|
|
|
|
target_link_libraries (clickhouse_common_io PUBLIC ch_contrib::aws_s3)
|
2019-12-03 16:23:24 +00:00
|
|
|
endif()
|
|
|
|
|
2022-01-17 19:42:00 +00:00
|
|
|
if (TARGET ch_contrib::azure_sdk)
|
2023-11-20 09:56:10 +00:00
|
|
|
target_link_libraries (clickhouse_common_io PUBLIC ch_contrib::azure_sdk)
|
2022-07-31 17:16:15 +00:00
|
|
|
dbms_target_link_libraries (PRIVATE ch_contrib::azure_sdk)
|
2021-09-27 09:31:27 +00:00
|
|
|
endif()
|
|
|
|
|
2022-01-17 05:53:49 +00:00
|
|
|
if (TARGET ch_contrib::s2)
|
|
|
|
dbms_target_link_libraries (PUBLIC ch_contrib::s2)
|
2021-07-06 11:34:33 +00:00
|
|
|
endif()
|
|
|
|
|
2024-02-16 17:22:22 +00:00
|
|
|
if (TARGET ch_contrib::vectorscan)
|
|
|
|
dbms_target_link_libraries (PRIVATE ch_contrib::vectorscan)
|
|
|
|
endif()
|
|
|
|
|
2022-01-17 18:48:14 +00:00
|
|
|
if (TARGET ch_contrib::brotli)
|
|
|
|
target_link_libraries (clickhouse_common_io PRIVATE ch_contrib::brotli)
|
2019-02-02 13:33:50 +00:00
|
|
|
endif()
|
|
|
|
|
2022-01-16 20:00:25 +00:00
|
|
|
if (TARGET ch_contrib::snappy)
|
|
|
|
target_link_libraries (clickhouse_common_io PUBLIC ch_contrib::snappy)
|
2021-11-05 11:55:30 +00:00
|
|
|
endif()
|
|
|
|
|
2022-01-17 19:53:36 +00:00
|
|
|
if (TARGET ch_contrib::amqp_cpp)
|
|
|
|
dbms_target_link_libraries(PUBLIC ch_contrib::amqp_cpp)
|
2021-04-09 12:47:26 +00:00
|
|
|
endif()
|
|
|
|
|
2022-01-17 20:53:49 +00:00
|
|
|
if (TARGET ch_contrib::sqlite)
|
|
|
|
dbms_target_link_libraries(PUBLIC ch_contrib::sqlite)
|
2021-07-09 14:22:53 +00:00
|
|
|
endif()
|
|
|
|
|
2023-01-04 14:22:39 +00:00
|
|
|
if (TARGET ch_contrib::bcrypt)
|
|
|
|
target_link_libraries (clickhouse_common_io PUBLIC ch_contrib::bcrypt)
|
|
|
|
endif()
|
|
|
|
|
2022-01-17 20:21:37 +00:00
|
|
|
if (TARGET ch_contrib::msgpack)
|
|
|
|
target_link_libraries (clickhouse_common_io PUBLIC ch_contrib::msgpack)
|
2020-07-10 18:27:10 +00:00
|
|
|
endif()
|
2020-04-04 14:02:14 +00:00
|
|
|
|
2022-06-27 08:38:00 +00:00
|
|
|
if (TARGET ch_contrib::liburing)
|
|
|
|
target_link_libraries (clickhouse_common_io PUBLIC ch_contrib::liburing)
|
|
|
|
target_include_directories (clickhouse_common_io SYSTEM BEFORE PUBLIC ${LIBURING_COMPAT_INCLUDE_DIR} ${LIBURING_INCLUDE_DIR})
|
|
|
|
endif()
|
|
|
|
|
2022-01-17 21:20:47 +00:00
|
|
|
target_link_libraries (clickhouse_common_io PUBLIC ch_contrib::fast_float)
|
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})
|
2023-05-18 15:23:39 +00:00
|
|
|
dbms_target_include_directories(SYSTEM BEFORE PUBLIC ${ORC_INCLUDE_DIR} "${PROJECT_BINARY_DIR}/contrib/orc/c++/include")
|
2020-06-26 20:17:28 +00:00
|
|
|
endif ()
|
2020-06-17 19:32:11 +00:00
|
|
|
|
2022-01-16 10:44:23 +00:00
|
|
|
if (TARGET ch_contrib::rocksdb)
|
|
|
|
dbms_target_link_libraries(PUBLIC ch_contrib::rocksdb)
|
2020-09-02 09:13:59 +00:00
|
|
|
endif()
|
|
|
|
|
2022-01-17 21:29:27 +00:00
|
|
|
if (TARGET ch_contrib::libpqxx)
|
|
|
|
dbms_target_link_libraries(PUBLIC ch_contrib::libpqxx)
|
2020-12-10 00:36:31 +00:00
|
|
|
endif()
|
|
|
|
|
2022-01-17 22:13:47 +00:00
|
|
|
if (TARGET ch_contrib::datasketches)
|
|
|
|
target_link_libraries (clickhouse_aggregate_functions PRIVATE ch_contrib::datasketches)
|
2021-02-25 16:44:01 +00:00
|
|
|
endif ()
|
|
|
|
|
2022-01-17 05:28:05 +00:00
|
|
|
target_link_libraries (clickhouse_common_io PRIVATE ch_contrib::lz4)
|
2021-06-17 08:31:37 +00:00
|
|
|
|
2022-07-05 18:08:44 +00:00
|
|
|
if (TARGET ch_contrib::qpl)
|
2023-12-12 16:15:11 +00:00
|
|
|
dbms_target_link_libraries(PUBLIC ch_contrib::qpl)
|
2022-06-01 15:47:43 +00:00
|
|
|
endif ()
|
2021-06-17 08:31:37 +00:00
|
|
|
|
2023-05-08 19:20:55 +00:00
|
|
|
if (TARGET ch_contrib::accel-config)
|
|
|
|
dbms_target_link_libraries(PUBLIC ch_contrib::accel-config)
|
|
|
|
endif ()
|
|
|
|
|
2023-12-05 22:47:18 +00:00
|
|
|
if (TARGET ch_contrib::qatzstd_plugin)
|
2023-12-11 18:31:52 +00:00
|
|
|
dbms_target_link_libraries(PUBLIC ch_contrib::qatzstd_plugin)
|
2023-12-05 22:47:18 +00:00
|
|
|
target_link_libraries(clickhouse_common_io PUBLIC ch_contrib::qatzstd_plugin)
|
|
|
|
endif ()
|
|
|
|
|
2023-05-05 16:26:53 +00:00
|
|
|
target_link_libraries(clickhouse_common_io PUBLIC boost::context)
|
|
|
|
dbms_target_link_libraries(PUBLIC boost::context)
|
2020-12-04 12:43:05 +00:00
|
|
|
|
2022-01-18 06:48:23 +00:00
|
|
|
if (ENABLE_NLP)
|
|
|
|
dbms_target_link_libraries (PUBLIC ch_contrib::stemmer)
|
|
|
|
dbms_target_link_libraries (PUBLIC ch_contrib::wnb)
|
|
|
|
dbms_target_link_libraries (PUBLIC ch_contrib::lemmagen)
|
2021-07-30 13:30:30 +00:00
|
|
|
endif()
|
2021-06-19 17:57:46 +00:00
|
|
|
|
2022-12-29 02:17:52 +00:00
|
|
|
if (TARGET ch_contrib::ulid)
|
|
|
|
dbms_target_link_libraries (PUBLIC ch_contrib::ulid)
|
|
|
|
endif()
|
2022-12-28 00:54:50 +00:00
|
|
|
|
2022-01-16 10:55:08 +00:00
|
|
|
if (TARGET ch_contrib::bzip2)
|
|
|
|
target_link_libraries (clickhouse_common_io PRIVATE ch_contrib::bzip2)
|
2021-08-06 23:55:04 +00:00
|
|
|
endif()
|
|
|
|
|
2023-07-28 13:00:35 +00:00
|
|
|
if (TARGET ch_contrib::libarchive)
|
|
|
|
target_link_libraries (clickhouse_common_io PUBLIC ch_contrib::libarchive)
|
|
|
|
endif()
|
2023-05-29 17:00:38 +00:00
|
|
|
|
2022-01-28 17:31:50 +00:00
|
|
|
if (TARGET ch_contrib::minizip)
|
|
|
|
target_link_libraries (clickhouse_common_io PRIVATE ch_contrib::minizip)
|
|
|
|
endif ()
|
|
|
|
|
2022-01-17 19:29:50 +00:00
|
|
|
if (TARGET ch_contrib::simdjson)
|
|
|
|
dbms_target_link_libraries(PRIVATE ch_contrib::simdjson)
|
2021-12-27 17:30:40 +00:00
|
|
|
endif()
|
|
|
|
|
2022-01-17 19:37:33 +00:00
|
|
|
if (TARGET ch_contrib::rapidjson)
|
2022-01-17 21:13:13 +00:00
|
|
|
dbms_target_link_libraries(PRIVATE ch_contrib::rapidjson)
|
2021-12-27 17:30:40 +00:00
|
|
|
endif()
|
|
|
|
|
2022-01-20 14:12:54 +00:00
|
|
|
dbms_target_link_libraries(PUBLIC ch_contrib::consistent_hashing)
|
2022-07-11 15:02:50 +00:00
|
|
|
|
2022-08-30 15:26:56 +00:00
|
|
|
if (TARGET ch_contrib::annoy)
|
|
|
|
dbms_target_link_libraries(PUBLIC ch_contrib::annoy)
|
|
|
|
endif()
|
|
|
|
|
2023-08-15 12:00:27 +00:00
|
|
|
if (TARGET ch_contrib::usearch)
|
|
|
|
dbms_target_link_libraries(PUBLIC ch_contrib::usearch)
|
|
|
|
endif()
|
|
|
|
|
2022-12-10 10:16:31 +00:00
|
|
|
if (TARGET ch_rust::skim)
|
|
|
|
dbms_target_include_directories(PRIVATE $<TARGET_PROPERTY:ch_rust::skim,INTERFACE_INCLUDE_DIRECTORIES>)
|
2023-02-23 14:45:32 +00:00
|
|
|
dbms_target_link_libraries(PUBLIC ch_rust::skim)
|
2022-12-10 10:16:31 +00:00
|
|
|
endif()
|
|
|
|
|
2022-01-17 20:26:05 +00:00
|
|
|
if (ENABLE_TESTS)
|
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
|
2022-05-17 20:47:33 +00:00
|
|
|
file(GLOB_RECURSE "${DST_VAR}" CONFIGURE_DEPENDS RELATIVE "${BASE_DIR}" "gtest*.cpp")
|
2018-01-09 17:27:02 +00:00
|
|
|
endmacro()
|
|
|
|
|
2017-03-22 16:59:02 +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)
|
2022-07-11 17:19:15 +00:00
|
|
|
clickhouse_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-sign-compare
|
|
|
|
)
|
2019-07-08 01:58:15 +00:00
|
|
|
|
2021-03-03 22:34:30 +00:00
|
|
|
target_link_libraries(unit_tests_dbms PRIVATE
|
2023-04-18 11:11:42 +00:00
|
|
|
ch_contrib::gmock_all
|
2023-10-13 07:47:58 +00:00
|
|
|
ch_contrib::gtest
|
2021-03-03 22:34:30 +00:00
|
|
|
clickhouse_functions
|
|
|
|
clickhouse_aggregate_functions
|
|
|
|
clickhouse_parsers
|
|
|
|
clickhouse_storages_system
|
|
|
|
dbms
|
2022-01-10 11:34:16 +00:00
|
|
|
clickhouse_common_config
|
2021-03-03 22:34:30 +00:00
|
|
|
clickhouse_common_zookeeper
|
2023-04-03 12:39:17 +00:00
|
|
|
string_utils
|
|
|
|
hilite_comparator)
|
2021-03-03 22:34:30 +00:00
|
|
|
|
2022-01-21 17:11:18 +00:00
|
|
|
if (TARGET ch_contrib::simdjson)
|
|
|
|
target_link_libraries(unit_tests_dbms PRIVATE ch_contrib::simdjson)
|
2021-04-23 12:53:38 +00:00
|
|
|
endif()
|
|
|
|
|
2022-03-10 12:09:48 +00:00
|
|
|
if (TARGET ch_contrib::yaml_cpp)
|
|
|
|
target_link_libraries(unit_tests_dbms PRIVATE ch_contrib::yaml_cpp)
|
2021-04-23 12:53:38 +00:00
|
|
|
endif()
|
|
|
|
|
2023-01-11 00:03:01 +00:00
|
|
|
if (TARGET ch_contrib::azure_sdk)
|
|
|
|
target_link_libraries(unit_tests_dbms PRIVATE ch_contrib::azure_sdk)
|
|
|
|
endif()
|
|
|
|
|
2023-03-27 12:22:07 +00:00
|
|
|
if (TARGET ch_contrib::parquet)
|
|
|
|
target_link_libraries(unit_tests_dbms PRIVATE ch_contrib::parquet)
|
|
|
|
endif()
|
2017-04-10 17:43:30 +00:00
|
|
|
endif ()
|