set(NO_ATOMIC_OPS 1)
endif(NOT ${ATOMIC_OPS_FOUND})
-option(WITH_GPERFTOOLS "gperftools is here" ON)
-if(${WITH_GPERFTOOLS})
- find_package(gperftools)
- set(HAVE_GPERFTOOLS ${GPERFTOOLS_FOUND})
- if(${HAVE_GPERFTOOLS})
- find_file(HAVE_GPERFTOOLS_HEAP_PROFILER_H heap-profiler.h PATHS /usr/include/gperftools)
- find_file(HAVE_GPERFTOOLS_MALLOC_EXTENSION_H malloc_extension.h PATHS /usr/include/gperftools)
- find_file(HAVE_GPERFTOOLS_PROFILER_H profiler.h PATHS /usr/include/gperftools)
- endif(${HAVE_GPERFTOOLS})
-endif(${WITH_GPERFTOOLS})
-
find_package(snappy REQUIRED)
#if allocator is set on command line make sure it matches below strings
option(WITH_PROFILER "build extra profiler binaries" OFF)
if(WITH_PROFILER)
+ find_package(gperftools REQUIRED)
list(APPEND EXTRALIBS profiler)
endif(WITH_PROFILER)
+if(WITH_PROFILER AND ALLOCATOR STREQUAL "tcmalloc")
+ find_file(HAVE_GPERFTOOLS_HEAP_PROFILER_H heap-profiler.h
+ PATHS ${GPERFTOOLS_INCLUDE_DIR})
+ find_file(HAVE_GPERFTOOLS_MALLOC_EXTENSION_H malloc_extension.h
+ PATHS ${GPERFTOOLS_INCLUDE_DIR})
+ find_file(HAVE_GPERFTOOLS_PROFILER_H profiler.h
+ PATHS ${GPERFTOOLS_INCLUDE_DIR})
+endif()
+
if(${ENABLE_COVERAGE})
find_program(HAVE_GCOV gcov)
if(NOT HAVE_GCOV)
add_library(common_mountcephfs_objs OBJECT
${common_mountcephfs_files})
-if(WITH_PROFILER AND HAVE_GPERFTOOLS)
+if(WITH_PROFILER)
list(APPEND libcommon_files
perfglue/cpu_profiler.cc)
else()
list(APPEND libcommon_files
perfglue/disabled_stubs.cc)
-endif(WITH_PROFILER AND HAVE_GPERFTOOLS)
+endif()
if(ENABLE_SHARED)
list(APPEND libcommon_files
${CMAKE_SOURCE_DIR}/src/test/encoding/ceph_dencoder.cc
APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_BINARY_DIR}/src/include/ceph_ver.h)
-if(${HAVE_GPERFTOOLS})
- target_link_libraries(common profiler)
-endif(${HAVE_GPERFTOOLS})
-
if(HAVE_ARMV8_CRC)
add_library(common_crc_aarch64 STATIC common/crc32c_aarch64.c)
set_target_properties(common_crc_aarch64 PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} ${ARM_CRC_FLAGS}")