Skip to content

Commit

Permalink
Conditionally compile extras like benchmarks and demos (facebookresea…
Browse files Browse the repository at this point in the history
…rch#4094)

Summary:
While embedding faiss as a subproject, these targets are quite useless. This PR adss a new `FAISS_ENABLE_EXTRAS` CMake option to exclude them, default is ON to preserve current behaviour.

Pull Request resolved: facebookresearch#4094

Reviewed By: satymish

Differential Revision: D67345666

Pulled By: gtwang01

fbshipit-source-id: c8d9ef14b21816e45f681412bda257192f5365d0
  • Loading branch information
artem authored and facebook-github-bot committed Dec 20, 2024
1 parent 5637bb8 commit 3a1ad46
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ option(FAISS_ENABLE_CUVS "Enable cuVS for GPU indexes." OFF)
option(FAISS_ENABLE_ROCM "Enable ROCm for GPU indexes." OFF)
option(FAISS_ENABLE_PYTHON "Build Python extension." ON)
option(FAISS_ENABLE_C_API "Build C API." OFF)
option(FAISS_ENABLE_EXTRAS "Build extras like benchmarks and demos" ON)
option(FAISS_USE_LTO "Enable Link-Time optimization" OFF)

if(FAISS_ENABLE_GPU)
Expand Down Expand Up @@ -103,10 +104,11 @@ if(FAISS_ENABLE_C_API)
add_subdirectory(c_api)
endif()

add_subdirectory(demos)
add_subdirectory(benchs)
add_subdirectory(tutorial/cpp)

if(FAISS_ENABLE_EXTRAS)
add_subdirectory(demos)
add_subdirectory(benchs)
add_subdirectory(tutorial/cpp)
endif()

# CTest must be included in the top level to enable `make test` target.
include(CTest)
Expand Down

0 comments on commit 3a1ad46

Please sign in to comment.