From: Kefu Chai Date: Wed, 20 Jul 2016 05:48:54 +0000 (+0800) Subject: cmake: add "WITH_PROFILER" option X-Git-Tag: ses5-milestone5~345^2~10 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=cf6dcf0ae7a21c88de8589dce83abb36baf8d716;p=ceph.git cmake: add "WITH_PROFILER" option 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 --- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3262674165db..b08b3b2f87ee 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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