diff --git a/programs/extract-from-config/CMakeLists.txt b/programs/extract-from-config/CMakeLists.txt index ff2d7937117..50585a564a7 100644 --- a/programs/extract-from-config/CMakeLists.txt +++ b/programs/extract-from-config/CMakeLists.txt @@ -5,6 +5,7 @@ set (CLICKHOUSE_EXTRACT_FROM_CONFIG_LINK boost::program_options clickhouse_common_config clickhouse_common_io + clickhouse_common_zookeeper_base clickhouse_common_zookeeper ) diff --git a/programs/keeper/CMakeLists.txt b/programs/keeper/CMakeLists.txt index 9b931c49c24..eaba1581ee4 100644 --- a/programs/keeper/CMakeLists.txt +++ b/programs/keeper/CMakeLists.txt @@ -7,6 +7,7 @@ set (CLICKHOUSE_KEEPER_LINK PRIVATE clickhouse_common_config clickhouse_common_io + clickhouse_common_zookeeper_base clickhouse_common_zookeeper daemon clickhouse-keeper-converter-lib diff --git a/programs/server/CMakeLists.txt b/programs/server/CMakeLists.txt index be696ff2afe..d3565211d14 100644 --- a/programs/server/CMakeLists.txt +++ b/programs/server/CMakeLists.txt @@ -8,6 +8,7 @@ set (CLICKHOUSE_SERVER_LINK clickhouse_aggregate_functions clickhouse_common_config clickhouse_common_io + clickhouse_common_zookeeper_base clickhouse_common_zookeeper clickhouse_functions clickhouse_parsers diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ac03f40cd93..a3631c856cb 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -415,6 +415,7 @@ dbms_target_link_libraries ( boost::filesystem boost::program_options clickhouse_common_config + clickhouse_common_zookeeper_base clickhouse_common_zookeeper clickhouse_dictionaries_embedded clickhouse_parsers @@ -660,6 +661,7 @@ if (ENABLE_TESTS) clickhouse_parsers clickhouse_storages_system dbms + clickhouse_common_zookeeper_base clickhouse_common_config clickhouse_common_zookeeper hilite_comparator) diff --git a/src/Common/Config/CMakeLists.txt b/src/Common/Config/CMakeLists.txt index e91a01568d5..05c2663b3f5 100644 --- a/src/Common/Config/CMakeLists.txt +++ b/src/Common/Config/CMakeLists.txt @@ -11,6 +11,7 @@ set (SRCS add_library(clickhouse_common_config ${SRCS}) target_link_libraries(clickhouse_common_config PUBLIC + clickhouse_common_zookeeper_base clickhouse_common_zookeeper common Poco::XML diff --git a/src/Common/ZooKeeper/CMakeLists.txt b/src/Common/ZooKeeper/CMakeLists.txt index b70a2299ba6..20a490ce085 100644 --- a/src/Common/ZooKeeper/CMakeLists.txt +++ b/src/Common/ZooKeeper/CMakeLists.txt @@ -1,10 +1,13 @@ include("${ClickHouse_SOURCE_DIR}/cmake/dbms_glob_sources.cmake") add_headers_and_sources(clickhouse_common_zookeeper .) +# Needed to build without Keeper (FreeBSD and other builds) +list(APPEND clickhouse_common_zookeeper_sources ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/Coordination/KeeperFeatureFlags.cpp) # Needs to be built differently depending on ZOOKEEPER_LOG list(REMOVE_ITEM clickhouse_common_zookeeper_sources "ZooKeeperImpl.cpp") + add_library(clickhouse_common_zookeeper_base ${clickhouse_common_zookeeper_headers} ${clickhouse_common_zookeeper_sources}) target_link_libraries (clickhouse_common_zookeeper_base PUBLIC @@ -18,14 +21,18 @@ add_library(clickhouse_common_zookeeper ZooKeeperImpl.cpp) target_compile_definitions (clickhouse_common_zookeeper PRIVATE -DZOOKEEPER_LOG) target_link_libraries (clickhouse_common_zookeeper PUBLIC - clickhouse_common_zookeeper_base + clickhouse_common_io + clickhouse_compression + common ) # for examples -- no logging (to avoid extra dependencies) add_library(clickhouse_common_zookeeper_no_log ZooKeeperImpl.cpp) target_link_libraries (clickhouse_common_zookeeper_no_log PUBLIC - clickhouse_common_zookeeper_base + clickhouse_common_io + clickhouse_compression + common ) if (ENABLE_EXAMPLES) add_subdirectory(examples) diff --git a/src/Common/ZooKeeper/examples/CMakeLists.txt b/src/Common/ZooKeeper/examples/CMakeLists.txt index 678b302a512..dd738e993de 100644 --- a/src/Common/ZooKeeper/examples/CMakeLists.txt +++ b/src/Common/ZooKeeper/examples/CMakeLists.txt @@ -1,15 +1,15 @@ clickhouse_add_executable(zkutil_test_commands zkutil_test_commands.cpp) target_link_libraries(zkutil_test_commands PRIVATE - clickhouse_common_zookeeper_no_log + clickhouse_common_zookeeper_base clickhouse_common_zookeeper_no_log dbms) clickhouse_add_executable(zkutil_test_commands_new_lib zkutil_test_commands_new_lib.cpp) target_link_libraries(zkutil_test_commands_new_lib PRIVATE - clickhouse_common_zookeeper_no_log + clickhouse_common_zookeeper_base clickhouse_common_zookeeper_no_log clickhouse_compression dbms) clickhouse_add_executable(zkutil_test_async zkutil_test_async.cpp) target_link_libraries(zkutil_test_async PRIVATE - clickhouse_common_zookeeper_no_log + clickhouse_common_zookeeper_base clickhouse_common_zookeeper_no_log dbms) diff --git a/src/Storages/System/CMakeLists.txt b/src/Storages/System/CMakeLists.txt index c7583713d2d..90fc7bf0541 100644 --- a/src/Storages/System/CMakeLists.txt +++ b/src/Storages/System/CMakeLists.txt @@ -47,6 +47,7 @@ add_library(clickhouse_storages_system ${storages_system_sources}) target_link_libraries(clickhouse_storages_system PRIVATE dbms common + clickhouse_common_zookeeper_base clickhouse_common_zookeeper clickhouse_parsers Poco::JSON diff --git a/src/Storages/examples/CMakeLists.txt b/src/Storages/examples/CMakeLists.txt index b4786b7313b..0c9a5b46801 100644 --- a/src/Storages/examples/CMakeLists.txt +++ b/src/Storages/examples/CMakeLists.txt @@ -5,4 +5,4 @@ clickhouse_add_executable (merge_selector2 merge_selector2.cpp) target_link_libraries (merge_selector2 PRIVATE dbms) clickhouse_add_executable (get_current_inserts_in_replicated get_current_inserts_in_replicated.cpp) -target_link_libraries (get_current_inserts_in_replicated PRIVATE dbms clickhouse_common_config clickhouse_common_zookeeper) +target_link_libraries (get_current_inserts_in_replicated PRIVATE dbms clickhouse_common_config clickhouse_common_zookeeper_base clickhouse_common_zookeeper) diff --git a/utils/zookeeper-cli/CMakeLists.txt b/utils/zookeeper-cli/CMakeLists.txt index fd2fa669f40..2d0769b7bf2 100644 --- a/utils/zookeeper-cli/CMakeLists.txt +++ b/utils/zookeeper-cli/CMakeLists.txt @@ -2,6 +2,7 @@ clickhouse_add_executable(clickhouse-zookeeper-cli zookeeper-cli.cpp ${ClickHouse_SOURCE_DIR}/src/Client/LineReader.cpp) target_link_libraries(clickhouse-zookeeper-cli PRIVATE + clickhouse_common_zookeeper_base clickhouse_common_zookeeper_no_log dbms clickhouse_functions diff --git a/utils/zookeeper-dump-tree/CMakeLists.txt b/utils/zookeeper-dump-tree/CMakeLists.txt index 3f3df65776a..835d37bd1cd 100644 --- a/utils/zookeeper-dump-tree/CMakeLists.txt +++ b/utils/zookeeper-dump-tree/CMakeLists.txt @@ -1,5 +1,6 @@ clickhouse_add_executable (zookeeper-dump-tree main.cpp ${SRCS}) target_link_libraries(zookeeper-dump-tree PRIVATE + clickhouse_common_zookeeper_base clickhouse_common_zookeeper_no_log clickhouse_common_io dbms diff --git a/utils/zookeeper-remove-by-list/CMakeLists.txt b/utils/zookeeper-remove-by-list/CMakeLists.txt index a4d7dccef65..4365c716596 100644 --- a/utils/zookeeper-remove-by-list/CMakeLists.txt +++ b/utils/zookeeper-remove-by-list/CMakeLists.txt @@ -1,5 +1,6 @@ clickhouse_add_executable (zookeeper-remove-by-list main.cpp ${SRCS}) target_link_libraries(zookeeper-remove-by-list PRIVATE + clickhouse_common_zookeeper_base clickhouse_common_zookeeper_no_log dbms clickhouse_functions