diff --git a/GaudiProfiling/CMakeLists.txt b/GaudiProfiling/CMakeLists.txt index 701d0915102006934fe7e5c104e01e5bbc82e1eb..67bd77afa9bba5b6f17dd6c2b1a0c61c536cc424 100644 --- a/GaudiProfiling/CMakeLists.txt +++ b/GaudiProfiling/CMakeLists.txt @@ -48,12 +48,15 @@ endif() # Google PerfTools profiler #----------------------------------- if(GAUDI_USE_GPERFTOOLS) + # Note we do not link against libtcmalloc.so or libprofiler.so as they have to be + # preloaded (see next comment) gaudi_add_module(GaudiGoogleProfiling SOURCES src/component/google/GoogleAuditor.cpp LINK GaudiKernel GaudiAlgLib - ZLIB::ZLIB - gperftools::gperftools) + ZLIB::ZLIB) + # but we still need to add the include directories to the search path + target_include_directories(GaudiGoogleProfiling PRIVATE ${GPERFTOOLS_INCLUDE_DIRS}) # Special handling of unresolved symbols in GaudiGoogleProfiling. # The profilers need to have libtcmalloc.so or libprofiler.so pre-loaded to diff --git a/cmake/modules/Findgperftools.cmake b/cmake/modules/Findgperftools.cmake index f9e2c0d06149432cf4633510666133ad33ad9ae6..080b24c814bc18e82f861af3fa7c3863ae79cfc0 100644 --- a/cmake/modules/Findgperftools.cmake +++ b/cmake/modules/Findgperftools.cmake @@ -133,7 +133,8 @@ endif() if(COMMAND __deprecate_var_for_target) foreach(v IN ITEMS GPERFTOOLS_INCLUDE_DIR - GPERFTOOLS_INCLUDE_DIRS GPERFTOOLS_TCMALLOC_LIBRARY + # GPERFTOOLS_INCLUDE_DIRS + GPERFTOOLS_TCMALLOC_LIBRARY GPERFTOOLS_TCMALLOC_DEBUG_LIBRARY GPERFTOOLS_TCMALLOC_MINIMAL_LIBRARY GPERFTOOLS_TCMALLOC_AND_PROFILER_LIBRARY