File tree Expand file tree Collapse file tree 3 files changed +16
-18
lines changed
Expand file tree Collapse file tree 3 files changed +16
-18
lines changed Original file line number Diff line number Diff line change 1+ include (FetchContent)
2+ option (BUILD_TESTING "" OFF )
3+ option (CMAKE_POSITION_INDEPENDENT_CODE "" ON )
4+ FetchContent_Declare(
5+ cpu_features
6+ GIT_REPOSITORY https://github.com/google/cpu_features.git
7+ )
8+ FetchContent_MakeAvailable(cpu_features)
Original file line number Diff line number Diff line change 11cmake_minimum_required (VERSION 3.10)
22
3- option (BUILD_TESTS "Build tests" ON )
3+ option (VECSIM_BUILD_TESTS "Build tests" ON )
44
55option (VECSIM_STATIC "Build as static library" OFF )
66
77option (USE_ASAN "Use AddressSanitizer (clang)" OFF )
88option (USE_MSAN "Use MemorySanitizer (clang)" OFF )
99
10- if (NOT DEFINED root)
11- get_filename_component (root ${CMAKE_CURRENT_LIST_DIR} /.. ABSOLUTE )
12- endif ()
10+ get_filename_component (root ${CMAKE_CURRENT_LIST_DIR} /.. ABSOLUTE )
1311message ("# VectorSimilarity root: " ${root} )
14- if (NOT DEFINED binroot)
15- get_filename_component (binroot ${CMAKE_CURRENT_BINARY_DIR} ABSOLUTE )
16- endif ()
12+ get_filename_component (binroot ${CMAKE_CURRENT_BINARY_DIR} ABSOLUTE )
1713message ("# VectorSimilarity binroot: " ${binroot} )
14+ message ("# VectorSimilarity static build: " ${VECSIM_STATIC} )
1815
1916include (${root} /cmake/common.cmake)
2017
2118if (USE_ASAN OR USE_MSAN)
2219 include (${root} /cmake/clang-sanitizers.cmake)
2320endif ()
2421
25- if (BUILD_TESTS )
22+ if (VECSIM_BUILD_TESTS )
2623 include (${root} /cmake/gtest.cmake)
2724 option (BUILD_TESTING "" ON )
2825endif ()
@@ -76,7 +73,7 @@ if(NOT VECSIM_STATIC)
7673 set_target_properties (VectorSimilarity PROPERTIES SUFFIX ".so" )
7774endif ()
7875
79- if (BUILD_TESTS )
76+ if (VECSIM_BUILD_TESTS )
8077 add_subdirectory (${root} /tests/unit unit_tests)
8178 add_subdirectory (${root} /tests/module module_tests)
8279
Original file line number Diff line number Diff line change 11project (VectorSimilarity_Spaces)
22
3- set (CMAKE_POSITION_INDEPENDENT_CODE ON )
4- include (FetchContent)
5- option (BUILD_TESTING "" OFF )
6- FetchContent_Declare(
7- cpu_features
8- GIT_REPOSITORY https://github.com/google/cpu_features.git
9- )
10- FetchContent_MakeAvailable(cpu_features)
3+ include (${root} /cmake/cpu_features.cmake)
4+
115if (VECSIM_MARCH)
126 add_compile_options (-march=${VECSIM_MARCH} )
137endif ()
3731endif ()
3832
3933add_library (VectorSimilaritySpaces STATIC ${SPACES_SOURCES} )
40-
4134target_link_libraries (VectorSimilaritySpaces cpu_features)
You can’t perform that action at this time.
0 commit comments