添加jemalloc支持

This commit is contained in:
771730766@qq.com 2018-01-30 11:26:32 +08:00
parent 8c50aa6c66
commit ddd4f57fe8
2 changed files with 17 additions and 1 deletions

View File

@ -87,7 +87,7 @@ if(ZLTOOLKIT_FOUND)
list(APPEND LINK_LIB_LIST ${ZLTOOLKIT_LIBRARIES}) list(APPEND LINK_LIB_LIST ${ZLTOOLKIT_LIBRARIES})
endif() endif()
#ZLToolKit #JEMALLOC
find_package(JEMALLOC QUIET) find_package(JEMALLOC QUIET)
if(JEMALLOC_FOUND) if(JEMALLOC_FOUND)
message(STATUS "找到JEMALLOC库:\"${JEMALLOC_INCLUDE_DIR}\"") message(STATUS "找到JEMALLOC库:\"${JEMALLOC_INCLUDE_DIR}\"")

16
cmake/FindJEMALLOC.cmake Normal file
View File

@ -0,0 +1,16 @@
find_path(JEMALLOC_INCLUDE_DIR
NAMES jemalloc/jemalloc.h
)
find_library(JEMALLOC_LIBRARY
NAMES jemalloc
)
set(JEMALLOC_INCLUDE_DIRS ${JEMALLOC_INCLUDE_DIR})
set(JEMALLOC_LIBRARIES ${JEMALLOC_LIBRARY})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(JEMALLOC DEFAULT_MSG JEMALLOC_LIBRARY JEMALLOC_INCLUDE_DIR)