]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: add "WITH_PROFILER" option
authorKefu Chai <kchai@redhat.com>
Wed, 20 Jul 2016 05:48:54 +0000 (13:48 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 20 Jul 2016 06:47:52 +0000 (14:47 +0800)
this option matches '--with-profiler' option in autoconf. and it is off
by default. we should not link against libprofiler unless asked to do
so. this change fixes this problem.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/CMakeLists.txt

index 3262674165db54bea36706da9961c20a975d0f3f..b08b3b2f87ee12495a8724325fd50d1e42dc3e85 100644 (file)
@@ -199,9 +199,10 @@ endif(INTEL_SSE4_1)
 
 set(EXTRALIBS uuid rt ${CMAKE_DL_LIBS} ${ATOMIC_OPS_LIBRARIES})
 
-if(${WITH_PROFILER})
+option(WITH_PROFILER "build extra profiler binaries" OFF)
+if(WITH_PROFILER)
   list(APPEND EXTRALIBS profiler)
-endif(${WITH_PROFILER})
+endif(WITH_PROFILER)
 
 if(${ENABLE_COVERAGE})
   find_program(HAVE_GCOV gcov)
@@ -475,13 +476,13 @@ set(common_mountcephfs_files
 add_library(common_mountcephfs_objs OBJECT
   ${common_mountcephfs_files})
 
-if(${HAVE_GPERFTOOLS})
+if(WITH_PROFILER AND HAVE_GPERFTOOLS)
   list(APPEND libcommon_files
     perfglue/cpu_profiler.cc)
 else()
   list(APPEND libcommon_files
     perfglue/disabled_stubs.cc)
-endif(${HAVE_GPERFTOOLS})
+endif(WITH_PROFILER AND HAVE_GPERFTOOLS)
 
 if(ENABLE_SHARED)
   list(APPEND libcommon_files