2017-01-27 20:00:02 +00:00
|
|
|
if (ENABLE_LIBTCMALLOC)
|
2017-02-06 20:30:19 +00:00
|
|
|
if (UNBUNDLED OR NOT USE_INTERNAL_GPERFTOOLS_LIBRARY)
|
2017-01-27 20:00:02 +00:00
|
|
|
find_package (Gperftools REQUIRED)
|
|
|
|
include_directories (${GPERFTOOLS_INCLUDE_DIR})
|
2017-02-03 15:19:12 +00:00
|
|
|
|
2017-02-06 20:30:19 +00:00
|
|
|
if (USE_STATIC_LIBRARIES AND CMAKE_SYSTEM MATCHES "FreeBSD")
|
|
|
|
#if (USE_STATIC_LIBRARIES)
|
2017-02-03 15:19:12 +00:00
|
|
|
find_library (UNWIND_LIBRARY unwind)
|
|
|
|
find_library (LZMA_LIBRARY lzma)
|
|
|
|
list (APPEND GPERFTOOLS_TCMALLOC ${UNWIND_LIBRARY} ${LZMA_LIBRARY})
|
|
|
|
endif ()
|
2017-01-27 20:00:02 +00:00
|
|
|
endif ()
|
|
|
|
|
2017-02-06 20:30:19 +00:00
|
|
|
if (NOT (GPERFTOOLS_INCLUDE_DIR AND GPERFTOOLS_TCMALLOC))
|
|
|
|
set(GPERFTOOLS_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/libtcmalloc/include/")
|
|
|
|
set(GPERFTOOLS_TCMALLOC tcmalloc_minimal_internal)
|
|
|
|
include_directories (BEFORE ${GPERFTOOLS_INCLUDE_DIR})
|
2017-01-27 20:00:02 +00:00
|
|
|
endif ()
|
2017-01-13 11:25:44 +00:00
|
|
|
|
2017-02-06 20:30:19 +00:00
|
|
|
set (USE_TCMALLOC 1)
|
|
|
|
|
2017-01-27 20:00:02 +00:00
|
|
|
message(STATUS "Using tcmalloc=${USE_TCMALLOC}: ${GPERFTOOLS_INCLUDE_DIR} : ${GPERFTOOLS_TCMALLOC}")
|
|
|
|
endif ()
|