From 1a22291df5ef008a8c2c6875d13094ba7356f2c8 Mon Sep 17 00:00:00 2001 From: David Faure Date: Mon, 9 Oct 2023 22:28:23 +0200 Subject: [PATCH] Update perfparser and use configure_file to generate config-perfparser.h This also fixes the build error if libdebuginfod is installed but not libdebuginfo-devel, i.e. if debuginfod.h is missing. --- 3rdparty/perfparser | 2 +- 3rdparty/perfparser.cmake | 17 +++++++++++++---- CMakeLists.txt | 3 +-- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/3rdparty/perfparser b/3rdparty/perfparser index 44b72d5c7..2408135a4 160000 --- a/3rdparty/perfparser +++ b/3rdparty/perfparser @@ -1 +1 @@ -Subproject commit 44b72d5c76cab80b0b7d32ac2073c28561b73ad6 +Subproject commit 2408135a455f70a3486e8cb5989b3dc6a89aaeaa diff --git a/3rdparty/perfparser.cmake b/3rdparty/perfparser.cmake index aeb3d67cc..18b62b3d0 100644 --- a/3rdparty/perfparser.cmake +++ b/3rdparty/perfparser.cmake @@ -3,13 +3,18 @@ check_submodule_exists(perfparser perfparser/app/perfdata.h) include(CheckSymbolExists) set(CMAKE_REQUIRED_INCLUDES ${LIBELF_INCLUDE_DIRS} ${LIBDW_INCLUDE_DIR}/elfutils ${LIBDWARF_INCLUDE_DIRS}) set(CMAKE_REQUIRED_LIBRARIES ${LIBDW_LIBRARIES} ${LIBELF_LIBRARIES}) -check_symbol_exists(dwfl_get_debuginfod_client "libdwfl.h" HAVE_DWFL_GET_DEBUGINFOD_CLIENT) +check_symbol_exists(dwfl_get_debuginfod_client "libdwfl.h" HAVE_DWFL_GET_DEBUGINFOD_CLIENT_SYMBOL) +set(CMAKE_REQUIRED_LIBRARIES ${LIBDEBUGINFOD_LIBRARIES}) +check_symbol_exists(debuginfod_set_user_data "debuginfod.h" HAVE_DEBUGINFOD_SET_USER_DATA) + + include_directories( ${LIBELF_INCLUDE_DIRS} ${LIBDW_INCLUDE_DIR}/elfutils ${LIBDWARF_INCLUDE_DIRS} perfparser/app + ${CMAKE_CURRENT_BINARY_DIR}/perfparser/app ) add_library(libhotspot-perfparser STATIC @@ -41,14 +46,18 @@ PUBLIC if (Zstd_FOUND) target_include_directories(libhotspot-perfparser PUBLIC ${Zstd_INCLUDE_DIR}) target_link_libraries(libhotspot-perfparser PUBLIC ${Zstd_LIBRARY}) - target_compile_definitions(libhotspot-perfparser PUBLIC HAVE_ZSTD=1) + set(HAVE_ZSTD 1) endif() -if (HAVE_DWFL_GET_DEBUGINFOD_CLIENT AND LIBDEBUGINFOD_LIBRARIES) +if (HAVE_DWFL_GET_DEBUGINFOD_CLIENT_SYMBOL AND HAVE_DEBUGINFOD_SET_USER_DATA) target_link_libraries(libhotspot-perfparser PRIVATE ${LIBDEBUGINFOD_LIBRARIES}) - target_compile_definitions(libhotspot-perfparser PRIVATE HAVE_DWFL_GET_DEBUGINFOD_CLIENT=1) + set(HAVE_DWFL_GET_DEBUGINFOD_CLIENT 1) endif() +add_feature_info(debuginfod HAVE_DWFL_GET_DEBUGINFOD_CLIENT "libdwfl and libdebuginfod are useful for on-demand fetching of debug symbols") + +configure_file(perfparser/app/config-perfparser.h.in perfparser/app/config-perfparser.h) + add_executable(hotspot-perfparser perfparser/app/main.cpp ) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4837ba1f9..ca7907837 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -140,8 +140,6 @@ set_package_properties( TYPE OPTIONAL ) -feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) - include(KDEInstallDirs) include(KDECMakeSettings) include(ECMAddTests) @@ -173,3 +171,4 @@ install( FILES com.kdab.Hotspot.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR} ) +feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)