Remove unbundled datasketches support

This commit is contained in:
Azat Khuzhin 2022-01-18 01:13:47 +03:00
parent 3147bbab51
commit 6a721baa59
6 changed files with 20 additions and 32 deletions

View File

@ -489,7 +489,6 @@ include (GNUInstallDirs)
include (cmake/find/llvm.cmake) include (cmake/find/llvm.cmake)
include (cmake/find/s3.cmake) include (cmake/find/s3.cmake)
include (cmake/find/nlp.cmake) include (cmake/find/nlp.cmake)
include (cmake/find/datasketches.cmake)
# Need to process before "contrib" dir: # Need to process before "contrib" dir:
include (cmake/find/mysqlclient.cmake) include (cmake/find/mysqlclient.cmake)

View File

@ -1,29 +0,0 @@
option (ENABLE_DATASKETCHES "Enable DataSketches" ${ENABLE_LIBRARIES})
if (ENABLE_DATASKETCHES)
option (USE_INTERNAL_DATASKETCHES_LIBRARY "Set to FALSE to use system DataSketches library instead of bundled" ON)
if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/datasketches-cpp/theta/CMakeLists.txt")
if (USE_INTERNAL_DATASKETCHES_LIBRARY)
message(WARNING "submodule contrib/datasketches-cpp is missing. to fix try run: \n git submodule update --init")
endif()
set(MISSING_INTERNAL_DATASKETCHES_LIBRARY 1)
set(USE_INTERNAL_DATASKETCHES_LIBRARY 0)
endif()
if (USE_INTERNAL_DATASKETCHES_LIBRARY)
set(DATASKETCHES_LIBRARY theta)
set(DATASKETCHES_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/datasketches-cpp/common/include" "${ClickHouse_SOURCE_DIR}/contrib/datasketches-cpp/theta/include")
elseif (NOT MISSING_INTERNAL_DATASKETCHES_LIBRARY)
find_library(DATASKETCHES_LIBRARY theta)
find_path(DATASKETCHES_INCLUDE_DIR NAMES theta_sketch.hpp PATHS ${DATASKETCHES_INCLUDE_PATHS})
endif()
if (DATASKETCHES_LIBRARY AND DATASKETCHES_INCLUDE_DIR)
set(USE_DATASKETCHES 1)
endif()
endif()
message (STATUS "Using datasketches=${USE_DATASKETCHES}: ${DATASKETCHES_INCLUDE_DIR} : ${DATASKETCHES_LIBRARY}")

View File

@ -139,6 +139,7 @@ add_subdirectory (libpqxx-cmake)
add_subdirectory (libpq-cmake) add_subdirectory (libpq-cmake)
add_subdirectory (nuraft-cmake) add_subdirectory (nuraft-cmake)
add_subdirectory (fast_float-cmake) add_subdirectory (fast_float-cmake)
add_subdirectory (datasketches-cpp-cmake)
if (USE_NLP) if (USE_NLP)
add_subdirectory(libstemmer-c-cmake) add_subdirectory(libstemmer-c-cmake)

View File

@ -0,0 +1,14 @@
option (ENABLE_DATASKETCHES "Enable DataSketches" ${ENABLE_LIBRARIES})
if (NOT ENABLE_DATASKETCHES)
message(STATUS "Not using DataSketches")
return()
endif()
set(DATASKETCHES_LIBRARY theta)
add_library(_datasketches INTERFACE)
target_include_directories(_datasketches SYSTEM BEFORE INTERFACE
"${ClickHouse_SOURCE_DIR}/contrib/datasketches-cpp/common/include"
"${ClickHouse_SOURCE_DIR}/contrib/datasketches-cpp/theta/include")
add_library(ch_contrib::datasketches ALIAS _datasketches)

View File

@ -485,8 +485,8 @@ if (TARGET ch_contrib::libpqxx)
dbms_target_link_libraries(PUBLIC ch_contrib::libpqxx) dbms_target_link_libraries(PUBLIC ch_contrib::libpqxx)
endif() endif()
if (USE_DATASKETCHES) if (TARGET ch_contrib::datasketches)
target_include_directories (clickhouse_aggregate_functions SYSTEM BEFORE PRIVATE ${DATASKETCHES_INCLUDE_DIR}) target_link_libraries (clickhouse_aggregate_functions PRIVATE ch_contrib::datasketches)
endif () endif ()
target_link_libraries (clickhouse_common_io PRIVATE ch_contrib::lz4) target_link_libraries (clickhouse_common_io PRIVATE ch_contrib::lz4)

View File

@ -67,3 +67,6 @@ endif()
if (TARGET ch_contrib::sentry) if (TARGET ch_contrib::sentry)
set(USE_SENTRY 1) set(USE_SENTRY 1)
endif() endif()
if (TARGET ch_contrib::datasketches)
set(USE_DATASKETCHES 1)
endif()