From 8c70de3bc7d5c04662bace07f9bf7703033d689f Mon Sep 17 00:00:00 2001 From: proller Date: Thu, 14 Mar 2019 23:52:10 +0300 Subject: [PATCH] Build fixes (freebsd) (#4696) --- cmake/find_gtest.cmake | 5 +++-- dbms/CMakeLists.txt | 4 +++- dbms/src/Columns/tests/CMakeLists.txt | 2 +- dbms/src/DataTypes/tests/CMakeLists.txt | 2 +- utils/zookeeper-cli/CMakeLists.txt | 2 +- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/cmake/find_gtest.cmake b/cmake/find_gtest.cmake index c918f81f1cd..82ae0f8e229 100644 --- a/cmake/find_gtest.cmake +++ b/cmake/find_gtest.cmake @@ -20,11 +20,12 @@ if (NOT GTEST_SRC_DIR AND NOT GTEST_INCLUDE_DIRS AND NOT MISSING_INTERNAL_GTEST_ set (USE_INTERNAL_GTEST_LIBRARY 1) set (GTEST_MAIN_LIBRARIES gtest_main) set (GTEST_LIBRARIES gtest) + set (GTEST_BOTH_LIBRARIES ${GTEST_MAIN_LIBRARIES} ${GTEST_LIBRARIES}) set (GTEST_INCLUDE_DIRS ${ClickHouse_SOURCE_DIR}/contrib/googletest/googletest) endif () -if((GTEST_INCLUDE_DIRS AND GTEST_MAIN_LIBRARIES) OR GTEST_SRC_DIR) +if((GTEST_INCLUDE_DIRS AND GTEST_BOTH_LIBRARIES) OR GTEST_SRC_DIR) set(USE_GTEST 1) endif() -message (STATUS "Using gtest=${USE_GTEST}: ${GTEST_INCLUDE_DIRS} : ${GTEST_LIBRARIES}, ${GTEST_MAIN_LIBRARIES} : ${GTEST_SRC_DIR}") +message (STATUS "Using gtest=${USE_GTEST}: ${GTEST_INCLUDE_DIRS} : ${GTEST_BOTH_LIBRARIES} : ${GTEST_SRC_DIR}") diff --git a/dbms/CMakeLists.txt b/dbms/CMakeLists.txt index 900b1e0a650..a07d658c4e6 100644 --- a/dbms/CMakeLists.txt +++ b/dbms/CMakeLists.txt @@ -184,7 +184,9 @@ target_link_libraries (clickhouse_common_io string_utils widechar_width ${LINK_LIBRARIES_ONLY_ON_X86_64} + PUBLIC ${DOUBLE_CONVERSION_LIBRARIES} + PRIVATE pocoext PUBLIC ${Poco_Net_LIBRARY} @@ -351,6 +353,6 @@ if (ENABLE_TESTS AND USE_GTEST) # attach all dbms gtest sources grep_gtest_sources(${ClickHouse_SOURCE_DIR}/dbms dbms_gtest_sources) add_executable(unit_tests_dbms ${dbms_gtest_sources}) - target_link_libraries(unit_tests_dbms PRIVATE gtest_main dbms clickhouse_common_zookeeper) + target_link_libraries(unit_tests_dbms PRIVATE ${GTEST_BOTH_LIBRARIES} dbms clickhouse_common_zookeeper) add_check(unit_tests_dbms) endif () diff --git a/dbms/src/Columns/tests/CMakeLists.txt b/dbms/src/Columns/tests/CMakeLists.txt index cc989e5f0bf..302c554a1fd 100644 --- a/dbms/src/Columns/tests/CMakeLists.txt +++ b/dbms/src/Columns/tests/CMakeLists.txt @@ -1,4 +1,4 @@ if(USE_GTEST) add_executable(column_unique column_unique.cpp) - target_link_libraries(column_unique PRIVATE dbms gtest_main) + target_link_libraries(column_unique PRIVATE dbms ${GTEST_BOTH_LIBRARIES}) endif() \ No newline at end of file diff --git a/dbms/src/DataTypes/tests/CMakeLists.txt b/dbms/src/DataTypes/tests/CMakeLists.txt index 5f699b29c59..aa4cb34620b 100644 --- a/dbms/src/DataTypes/tests/CMakeLists.txt +++ b/dbms/src/DataTypes/tests/CMakeLists.txt @@ -7,5 +7,5 @@ target_link_libraries (data_type_string PRIVATE dbms) if(USE_GTEST) add_executable(data_type_get_common_type data_type_get_common_type.cpp) - target_link_libraries(data_type_get_common_type PRIVATE dbms gtest_main) + target_link_libraries(data_type_get_common_type PRIVATE dbms ${GTEST_BOTH_LIBRARIES}) endif() diff --git a/utils/zookeeper-cli/CMakeLists.txt b/utils/zookeeper-cli/CMakeLists.txt index 89db7922edd..550d0e855d8 100644 --- a/utils/zookeeper-cli/CMakeLists.txt +++ b/utils/zookeeper-cli/CMakeLists.txt @@ -1,5 +1,5 @@ add_executable(clickhouse-zookeeper-cli zookeeper-cli.cpp) -target_link_libraries(clickhouse-zookeeper-cli PRIVATE clickhouse_common_zookeeper ${LINE_EDITING_LIBS}) +target_link_libraries(clickhouse-zookeeper-cli PRIVATE clickhouse_common_zookeeper ${Poco_Foundation_LIBRARY} ${LINE_EDITING_LIBS}) if (READLINE_INCLUDE_DIR) target_include_directories (clickhouse-zookeeper-cli SYSTEM PRIVATE ${READLINE_INCLUDE_DIR}) endif ()