ClickHouse/contrib/usearch-cmake/CMakeLists.txt

19 lines
888 B
CMake
Raw Normal View History

set(USEARCH_PROJECT_DIR "${ClickHouse_SOURCE_DIR}/contrib/usearch")
2023-08-15 12:00:27 +00:00
add_library(_usearch INTERFACE)
2024-09-09 16:39:32 +00:00
target_include_directories(_usearch SYSTEM INTERFACE ${USEARCH_PROJECT_DIR}/include)
2024-09-09 16:39:32 +00:00
target_link_libraries(_usearch INTERFACE _fp16)
2024-08-14 15:03:55 +00:00
target_compile_definitions(_usearch INTERFACE USEARCH_USE_FP16LIB)
# SimSIMD supports x86 and ARM platforms. The latter requires Clang 19 because older versions had a buggy bf16 implementation.
if (ARCH_AMD64 OR (ARCH_AARCH64 AND NOT NO_ARMV81_OR_HIGHER AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19))
2024-11-01 12:17:40 +00:00
target_link_libraries(_usearch INTERFACE _simsimd)
target_compile_definitions(_usearch INTERFACE USEARCH_USE_SIMSIMD)
target_compile_definitions(_usearch INTERFACE USEARCH_CAN_COMPILE_FLOAT16)
target_compile_definitions(_usearch INTERFACE USEARCH_CAN_COMPILE_BF16)
endif ()
2024-08-14 15:03:55 +00:00
2023-08-15 12:00:27 +00:00
add_library(ch_contrib::usearch ALIAS _usearch)