Skip to content

Commit 3a1ad46

Browse files
artemfacebook-github-bot
authored andcommitted
Conditionally compile extras like benchmarks and demos (#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: #4094 Reviewed By: satymish Differential Revision: D67345666 Pulled By: gtwang01 fbshipit-source-id: c8d9ef14b21816e45f681412bda257192f5365d0
1 parent 5637bb8 commit 3a1ad46

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

CMakeLists.txt

+6-4
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ option(FAISS_ENABLE_CUVS "Enable cuVS for GPU indexes." OFF)
6464
option(FAISS_ENABLE_ROCM "Enable ROCm for GPU indexes." OFF)
6565
option(FAISS_ENABLE_PYTHON "Build Python extension." ON)
6666
option(FAISS_ENABLE_C_API "Build C API." OFF)
67+
option(FAISS_ENABLE_EXTRAS "Build extras like benchmarks and demos" ON)
6768
option(FAISS_USE_LTO "Enable Link-Time optimization" OFF)
6869

6970
if(FAISS_ENABLE_GPU)
@@ -103,10 +104,11 @@ if(FAISS_ENABLE_C_API)
103104
add_subdirectory(c_api)
104105
endif()
105106

106-
add_subdirectory(demos)
107-
add_subdirectory(benchs)
108-
add_subdirectory(tutorial/cpp)
109-
107+
if(FAISS_ENABLE_EXTRAS)
108+
add_subdirectory(demos)
109+
add_subdirectory(benchs)
110+
add_subdirectory(tutorial/cpp)
111+
endif()
110112

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

0 commit comments

Comments
 (0)