Skip to content

Commit

Permalink
We need to enable the c_api by default
Browse files Browse the repository at this point in the history
  • Loading branch information
robertmaynard committed Oct 16, 2024
1 parent f62b217 commit 5951281
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
18 changes: 4 additions & 14 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

option(BUILD_SHARED_LIBS "Build cuvs shared libraries" ON)
option(BUILD_TESTS "Build cuvs unit-tests" ON)
option(BUILD_C_LIBRARY "Build cuVS C API library" OFF)
option(BUILD_C_TESTS "Build cuVS C API tests" OFF)
option(BUILD_C_LIBRARY "Build cuVS C API library" ON)
option(BUILD_CUVS_BENCH "Build cuVS ann benchmarks" OFF)
option(BUILD_CAGRA_HNSWLIB "Build CAGRA+hnswlib interface" ON)
option(BUILD_MG_ALGOS "Build with multi-GPU support" ON)
Expand All @@ -72,21 +71,12 @@ option(DISABLE_OPENMP "Disable OpenMP" OFF)
option(CUVS_NVTX "Enable nvtx markers" OFF)
option(CUVS_RAFT_CLONE_ON_PIN "Explicitly clone RAFT branch when pinned to non-feature branch" ON)

if((BUILD_TESTS OR BUILD_C_LIBRARY) AND NOT BUILD_CPU_ONLY)

endif()

if(BUILD_CPU_ONLY)
set(BUILD_SHARED_LIBS OFF)
set(BUILD_TESTS OFF)
set(BUILD_C_LIBRARY OFF)
endif()

if(NOT BUILD_C_LIBRARY)
set(BUILD_C_TESTS OFF)
endif()

if(NOT BUILD_SHARED_LIBS)
set(BUILD_CAGRA_HNSWLIB OFF)
elseif(NOT BUILD_SHARED_LIBS)
set(BUILD_TESTS OFF)
set(BUILD_C_LIBRARY OFF)
set(BUILD_CAGRA_HNSWLIB OFF)
Expand Down Expand Up @@ -771,7 +761,7 @@ endif()
# ##################################################################################################
# * build test executable ----------------------------------------------------

if(BUILD_TESTS OR BUILD_C_TESTS)
if(BUILD_TESTS)
add_subdirectory(internal)
add_subdirectory(test)
endif()
Expand Down
4 changes: 2 additions & 2 deletions cpp/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ if(BUILD_TESTS)
)
endif()

if(BUILD_C_TESTS)
if(TARGET cuvs::c_api)
ConfigureTest(NAME INTEROP_TEST PATH core/interop.cu C_LIB)
ConfigureTest(
NAME DISTANCE_C_TEST PATH distance/run_pairwise_distance_c.c distance/pairwise_distance_c.cu
Expand Down Expand Up @@ -246,7 +246,7 @@ endif()
# ##################################################################################################
rapids_test_install_relocatable(INSTALL_COMPONENT_SET testing DESTINATION bin/gtests/libcuvs)

if(BUILD_C_TESTS)
if(TARGET cuvs::c_api)
enable_language(C)

add_executable(cuvs_c_test core/c_api.c)
Expand Down

0 comments on commit 5951281

Please sign in to comment.