Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update perfparser and use configure_file to generate config-perfparser.h #517

Merged
merged 1 commit into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions 3rdparty/perfparser.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
)
Expand Down
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,6 @@ set_package_properties(
TYPE OPTIONAL
)

feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)

include(KDEInstallDirs)
include(KDECMakeSettings)
include(ECMAddTests)
Expand Down Expand Up @@ -173,3 +171,4 @@ install(
FILES com.kdab.Hotspot.appdata.xml
DESTINATION ${KDE_INSTALL_METAINFODIR}
)
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)