diff --git a/CMakeLists.txt b/CMakeLists.txt index 023445e4..f56d45dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -441,8 +441,17 @@ if(BUILD_UNIVERSAL_DDPROF) endif() endif() +set(_install_targets ddprof dd_profiling-static dd_profiling-shared) +if(USE_LOADER) + # Install the embedded profiling library so the loader can dlopen it from a + # standard path instead of extracting the copy baked into the loader to /tmp. + # The /tmp fallback loses file capabilities (CAP_PERFMON) on the ddprof + # binary, which breaks perf_event_open. + list(APPEND _install_targets dd_profiling-embedded) +endif() + install( - TARGETS ddprof dd_profiling-static dd_profiling-shared + TARGETS ${_install_targets} RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib