Fix MinGW build error (#16267)

Signed-off-by: yudong.cai <yudong.cai@zilliz.com>
This commit is contained in:
Cai Yudong 2022-03-30 00:15:27 +08:00 committed by GitHub
parent cd0f3cbcd3
commit 0baa8c60a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -58,11 +58,20 @@ macro(build_knowhere)
endif()
add_library(knowhere SHARED IMPORTED)
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()