From 7420bd9b18cde4ff76d3767ae7be9faf6cea4602 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Tue, 18 Jan 2022 00:37:14 +0300 Subject: [PATCH] Move pdqsort --- CMakeLists.txt | 1 - cmake/find/pdqsort.cmake | 2 -- contrib/CMakeLists.txt | 1 + contrib/pdqsort-cmake/CMakeLists.txt | 3 +++ src/CMakeLists.txt | 10 ++++++---- src/Common/examples/CMakeLists.txt | 3 +-- 6 files changed, 11 insertions(+), 9 deletions(-) delete mode 100644 cmake/find/pdqsort.cmake create mode 100644 contrib/pdqsort-cmake/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 4e576c46bb3..9ca4e5ed7e5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -491,7 +491,6 @@ include (cmake/find/libgsasl.cmake) include (cmake/find/cyrus-sasl.cmake) include (cmake/find/llvm.cmake) include (cmake/find/libxml2.cmake) -include (cmake/find/pdqsort.cmake) include (cmake/find/curl.cmake) include (cmake/find/s3.cmake) include (cmake/find/nlp.cmake) diff --git a/cmake/find/pdqsort.cmake b/cmake/find/pdqsort.cmake deleted file mode 100644 index 51461044cf9..00000000000 --- a/cmake/find/pdqsort.cmake +++ /dev/null @@ -1,2 +0,0 @@ -set(PDQSORT_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/contrib/pdqsort) -message(STATUS "Using pdqsort: ${PDQSORT_INCLUDE_DIR}") diff --git a/contrib/CMakeLists.txt b/contrib/CMakeLists.txt index 11c13d35770..89f774eede9 100644 --- a/contrib/CMakeLists.txt +++ b/contrib/CMakeLists.txt @@ -22,6 +22,7 @@ endif() set_property(DIRECTORY PROPERTY EXCLUDE_FROM_ALL 1) add_subdirectory (miniselect-cmake) +add_subdirectory (pdqsort-cmake) add_subdirectory (sparsehash-c11-cmake) add_subdirectory (abseil-cpp-cmake) add_subdirectory (magic-enum-cmake) diff --git a/contrib/pdqsort-cmake/CMakeLists.txt b/contrib/pdqsort-cmake/CMakeLists.txt new file mode 100644 index 00000000000..485f345807e --- /dev/null +++ b/contrib/pdqsort-cmake/CMakeLists.txt @@ -0,0 +1,3 @@ +add_library(_pdqsort INTERFACE) +target_include_directories(_pdqsort SYSTEM BEFORE INTERFACE ${ClickHouse_SOURCE_DIR}/contrib/pdqsort) +add_library(ch_contrib::pdqsort ALIAS _pdqsort) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 10d95dd30f2..47c178ee3fb 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -378,10 +378,12 @@ dbms_target_link_libraries ( 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") -target_include_directories(clickhouse_common_io SYSTEM BEFORE PUBLIC ${PDQSORT_INCLUDE_DIR}) -dbms_target_include_directories(SYSTEM BEFORE PUBLIC ${PDQSORT_INCLUDE_DIR}) -target_link_libraries(clickhouse_common_io PUBLIC ch_contrib::miniselect) -dbms_target_link_libraries(PUBLIC ch_contrib::miniselect) +target_link_libraries(clickhouse_common_io PUBLIC + ch_contrib::miniselect + ch_contrib::pdqsort) +dbms_target_link_libraries(PUBLIC + ch_contrib::miniselect + ch_contrib::pdqsort) dbms_target_link_libraries(PRIVATE ch_contrib::zstd) target_link_libraries (clickhouse_common_io PUBLIC ch_contrib::zstd) diff --git a/src/Common/examples/CMakeLists.txt b/src/Common/examples/CMakeLists.txt index d4057954969..a0628f0540c 100644 --- a/src/Common/examples/CMakeLists.txt +++ b/src/Common/examples/CMakeLists.txt @@ -23,8 +23,7 @@ add_executable (compact_array compact_array.cpp) target_link_libraries (compact_array PRIVATE clickhouse_common_io) add_executable (radix_sort radix_sort.cpp) -target_link_libraries (radix_sort PRIVATE clickhouse_common_io) -target_include_directories(radix_sort SYSTEM PRIVATE ${PDQSORT_INCLUDE_DIR}) +target_link_libraries (radix_sort PRIVATE clickhouse_common_io ch_contrib::pdqsort) add_executable (arena_with_free_lists arena_with_free_lists.cpp) target_link_libraries (arena_with_free_lists PRIVATE dbms)