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_proto
milvus_query milvus_query
milvus_utils milvus_utils
# gperftools
) )

View File

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

View File

@ -85,12 +85,12 @@ macro( build_gperftools )
ExternalProject_Get_Property( gperftools_ep INSTALL_DIR ) ExternalProject_Get_Property( gperftools_ep INSTALL_DIR )
file(MAKE_DIRECTORY ${INSTALL_DIR}/include) file(MAKE_DIRECTORY ${INSTALL_DIR}/include)
# libprofiler.a # libprofiler.so
add_library( gperftools STATIC IMPORTED ) add_library( gperftools SHARED IMPORTED )
set_target_properties( gperftools set_target_properties( gperftools
PROPERTIES PROPERTIES
IMPORTED_GLOBAL TRUE 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_INCLUDE_DIRECTORIES "${INSTALL_DIR}/include"
INTERFACE_LINK_LIBRARIES libunwind INTERFACE_LINK_LIBRARIES libunwind
) )
@ -100,3 +100,6 @@ endmacro()
build_libunwind() build_libunwind()
build_gperftools() 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 milvus_indexbuilder
log log
pthread pthread
gperftools
) )
target_link_libraries(all_tests target_link_libraries(all_tests
@ -69,7 +68,6 @@ target_link_libraries(all_tests
milvus_indexbuilder milvus_indexbuilder
log log
pthread pthread
gperftools
) )
install(TARGETS all_tests DESTINATION unittest) install(TARGETS all_tests DESTINATION unittest)