From 8e6ddc931a6d6eef8ad88a526cf8688b49d46211 Mon Sep 17 00:00:00 2001 From: ptaylor Date: Fri, 2 Jul 2021 22:55:42 -0500 Subject: [PATCH] always add faiss library alias if it's missing --- cpp/cmake/thirdparty/get_faiss.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cpp/cmake/thirdparty/get_faiss.cmake b/cpp/cmake/thirdparty/get_faiss.cmake index 4991990e379..a65401579cb 100644 --- a/cpp/cmake/thirdparty/get_faiss.cmake +++ b/cpp/cmake/thirdparty/get_faiss.cmake @@ -40,7 +40,10 @@ function(find_and_configure_faiss) if(FAISS_ADDED) set(FAISS_GPU_HEADERS ${FAISS_SOURCE_DIR} PARENT_SCOPE) - add_library(FAISS::FAISS ALIAS faiss) + endif() + + if(TARGET faiss AND NOT TARGET FAISS::FAISS) + add_library(FAISS::FAISS ALIAS faiss) endif() endfunction()