From 0baa8c60a57228d38c1343cea40dae2b1a6fe056 Mon Sep 17 00:00:00 2001 From: Cai Yudong Date: Wed, 30 Mar 2022 00:15:27 +0800 Subject: [PATCH] Fix MinGW build error (#16267) Signed-off-by: yudong.cai --- internal/core/thirdparty/knowhere/CMakeLists.txt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/internal/core/thirdparty/knowhere/CMakeLists.txt b/internal/core/thirdparty/knowhere/CMakeLists.txt index 6b4a14b1d3..2927c9e480 100644 --- a/internal/core/thirdparty/knowhere/CMakeLists.txt +++ b/internal/core/thirdparty/knowhere/CMakeLists.txt @@ -58,11 +58,20 @@ macro(build_knowhere) endif() add_library(knowhere SHARED IMPORTED) - set_target_properties( knowhere + + if (MSYS) + set_target_properties( knowhere PROPERTIES + IMPORTED_GLOBAL TRUE + IMPORTED_IMPLIB ${INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/${CMAKE_SHARED_LIBRARY_PREFIX}knowhere${CMAKE_SHARED_LIBRARY_SUFFIX}.a + INTERFACE_INCLUDE_DIRECTORIES ${INSTALL_DIR}/${CMAKE_INSTALL_INCLUDEDIR}) + else () + set_target_properties( knowhere + PROPERTIES IMPORTED_GLOBAL TRUE IMPORTED_LOCATION ${INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/${CMAKE_SHARED_LIBRARY_PREFIX}knowhere${CMAKE_SHARED_LIBRARY_SUFFIX} INTERFACE_INCLUDE_DIRECTORIES ${INSTALL_DIR}/${CMAKE_INSTALL_INCLUDEDIR}) + endif () add_dependencies(knowhere knowhere_ep) endmacro()