Skip to content

Commit

Permalink
feat: Add build option for specifying gperf path (acts-project#1273)
Browse files Browse the repository at this point in the history
The location for a gperf install can be sepcified at buiild time to
allow for greater flexibility and lowest privilleges when installing the
tool
  • Loading branch information
Scott-James-Hurley committed Jun 7, 2022
1 parent 40984ff commit 95b07ed
Showing 1 changed file with 24 additions and 6 deletions.
30 changes: 24 additions & 6 deletions Core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,18 @@ endif()

if(ACTS_ENABLE_CPU_PROFILING)
message(STATUS "added lprofiler")
target_link_libraries(
ActsCore
PUBLIC -lprofiler)

if(DEFINED GPERF_INSTALL_DIR)
find_library(PROFILER_LIBRARY profiler HINTS ${GPERF_INSTALL_DIR})

target_link_libraries(
ActsCore
PUBLIC ${PROFILER_LIBRARY})
else()
target_link_libraries(
ActsCore
PUBLIC -lprofiler)
endif()

target_link_options(
ActsCore
Expand All @@ -50,9 +59,18 @@ endif()

if(ACTS_ENABLE_MEMORY_PROFILING)
message(STATUS "added ltcmalloc")
target_link_libraries(
ActsCore
PUBLIC -ltcmalloc)

if(DEFINED GPERF_INSTALL_DIR)
find_library(TCMALLOC_LIBRARY tcmalloc HINTS ${GPERF_INSTALL_DIR})

target_link_libraries(
ActsCore
PUBLIC ${TCMALLOC_LIBRARY})
else()
target_link_libraries(
ActsCore
PUBLIC -ltcmalloc)
endif()
endif()

install(
Expand Down

0 comments on commit 95b07ed

Please sign in to comment.