Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions cpp/cmake/thirdparty/get_faiss.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#=============================================================================
# cmake-format: off
# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION.
# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION.
# SPDX-License-Identifier: Apache-2.0
# cmake-format: on
#=============================================================================
Expand Down Expand Up @@ -82,7 +82,7 @@ function(find_and_configure_faiss)
NAMESPACE faiss::)
endif()

# Need to tell CMake to rescan the link group of faiss::faiss_gpu_objs and faiss
# Need to tell CMake to rescan the link group of faiss and include faiss_gpu_objs
# so that we get proper link order when they are static
#
# We don't look at the existence of `faiss_avx2` as it will always exist
Expand All @@ -91,9 +91,9 @@ function(find_and_configure_faiss)
# a dependency to it. Adding a dependency will cause it to compile,
# and fail due to invalid compiler flags.
if(PKG_ENABLE_GPU AND PKG_BUILD_STATIC_LIBS AND CXX_AVX2_FOUND)
set(CUVS_FAISS_TARGETS "$<LINK_GROUP:RESCAN,$<LINK_LIBRARY:WHOLE_ARCHIVE,faiss_gpu_objs>,faiss::faiss_avx2>" PARENT_SCOPE)
set(CUVS_FAISS_TARGETS "$<TARGET_OBJECTS:faiss_gpu_objs>;$<LINK_GROUP:RESCAN,$<LINK_LIBRARY:WHOLE_ARCHIVE,faiss::faiss_avx2>>" PARENT_SCOPE)
elseif(PKG_ENABLE_GPU AND PKG_BUILD_STATIC_LIBS)
set(CUVS_FAISS_TARGETS "$<LINK_GROUP:RESCAN,$<LINK_LIBRARY:WHOLE_ARCHIVE,faiss_gpu_objs>,faiss::faiss>" PARENT_SCOPE)
set(CUVS_FAISS_TARGETS "$<TARGET_OBJECTS:faiss_gpu_objs>;$<LINK_GROUP:RESCAN,$<LINK_LIBRARY:WHOLE_ARCHIVE,faiss::faiss>>" PARENT_SCOPE)
elseif(CXX_AVX2_FOUND)
set(CUVS_FAISS_TARGETS faiss::faiss_avx2 PARENT_SCOPE)
else()
Expand Down
Loading