-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
62 lines (52 loc) · 1.63 KB
/
Copy pathCMakeLists.txt
File metadata and controls
62 lines (52 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
cmake_minimum_required(VERSION 3.16)
project(vectorindex VERSION 0.1.0 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
option(VECTORINDEX_BUILD_TESTS "Build vectorindex tests" ON)
option(VECTORINDEX_BUILD_BENCH "Build vectorindex benchmark runner" ON)
add_library(vectorindex
src/brute_force_index.cpp
src/distance.cpp
src/hnsw_index.cpp
src/ivf_index.cpp
src/kmeans.cpp
src/mmap_vector_store.cpp
src/wal_index.cpp
)
target_include_directories(vectorindex
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
target_compile_options(vectorindex PRIVATE
$<$<CXX_COMPILER_ID:GNU,Clang>:-Wall -Wextra -Wpedantic>
)
if(VECTORINDEX_BUILD_TESTS)
enable_testing()
add_executable(vectorindex_tests
tests/test_brute_force.cpp
tests/test_hnsw.cpp
tests/test_infra.cpp
tests/test_ivf.cpp
tests/test_main.cpp
tests/test_recall.cpp
)
target_link_libraries(vectorindex_tests PRIVATE vectorindex)
add_test(NAME vectorindex_tests COMMAND vectorindex_tests)
endif()
if(VECTORINDEX_BUILD_BENCH)
add_executable(vectorindex_bench
bench/ann_dataset_loader.cpp
bench/benchmark_runner.cpp
bench/dataset_generator.cpp
bench/ground_truth.cpp
)
target_link_libraries(vectorindex_bench PRIVATE vectorindex)
add_executable(hnsw_scale_bench
bench/hnsw_scale_bench.cpp
bench/dataset_generator.cpp
bench/ground_truth.cpp
)
target_link_libraries(hnsw_scale_bench PRIVATE vectorindex)
endif()