Update profiler CMakeLists.txt (#13001)

Signed-off-by: yudong.cai <yudong.cai@zilliz.com>
This commit is contained in:
Cai Yudong 2021-12-08 23:23:06 +08:00 committed by GitHub
parent 59c93eb351
commit 1ae249adb5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 6 deletions

View File

@ -44,5 +44,6 @@ target_link_libraries(milvus_segcore
milvus_proto
milvus_query
milvus_utils
# gperftools
)

View File

@ -42,7 +42,7 @@ find_package( Threads REQUIRED )
if ( MILVUS_BUILD_TESTS )
add_subdirectory( gtest )
add_subdirectory( google_benchmark )
add_subdirectory( profilers )
add_subdirectory( profiler )
endif()

View File

@ -85,12 +85,12 @@ macro( build_gperftools )
ExternalProject_Get_Property( gperftools_ep INSTALL_DIR )
file(MAKE_DIRECTORY ${INSTALL_DIR}/include)
# libprofiler.a
add_library( gperftools STATIC IMPORTED )
# libprofiler.so
add_library( gperftools SHARED IMPORTED )
set_target_properties( gperftools
PROPERTIES
IMPORTED_GLOBAL TRUE
IMPORTED_LOCATION "${INSTALL_DIR}/lib/libtcmalloc_and_profiler.a"
IMPORTED_LOCATION "${INSTALL_DIR}/lib/libtcmalloc_and_profiler.so"
INTERFACE_INCLUDE_DIRECTORIES "${INSTALL_DIR}/include"
INTERFACE_LINK_LIBRARIES libunwind
)
@ -100,3 +100,6 @@ endmacro()
build_libunwind()
build_gperftools()
get_target_property( GPERFTOOLS_LIB gperftools LOCATION )
install(FILES ${GPERFTOOLS_LIB} DESTINATION ${CMAKE_INSTALL_PREFIX})

View File

@ -60,7 +60,6 @@ target_link_libraries(index_builder_test
milvus_indexbuilder
log
pthread
gperftools
)
target_link_libraries(all_tests
@ -69,7 +68,6 @@ target_link_libraries(all_tests
milvus_indexbuilder
log
pthread
gperftools
)
install(TARGETS all_tests DESTINATION unittest)