mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-25 07:24:36 +00:00
Proper way of enabling libdebuginfod.
This commit is contained in:
parent
157bf05c50
commit
6721db8600
@ -54,6 +54,13 @@ if(TRACY_LIBUNWIND_BACKTRACE)
|
|||||||
target_link_libraries(TracyClient INTERFACE ${unwind_LINK_LIBRARIES})
|
target_link_libraries(TracyClient INTERFACE ${unwind_LINK_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(TRACY_DEBUGINFOD)
|
||||||
|
include(FindPkgConfig)
|
||||||
|
pkg_check_modules(debuginfod REQUIRED libdebuginfod)
|
||||||
|
target_include_directories(TracyClient INTERFACE ${debuginfod_INCLUDE_DIRS})
|
||||||
|
target_link_libraries(TracyClient INTERFACE ${debuginfod_LINK_LIBRARIES})
|
||||||
|
endif()
|
||||||
|
|
||||||
add_library(Tracy::TracyClient ALIAS TracyClient)
|
add_library(Tracy::TracyClient ALIAS TracyClient)
|
||||||
|
|
||||||
macro(set_option option help value)
|
macro(set_option option help value)
|
||||||
@ -91,6 +98,7 @@ set_option(TRACY_TIMER_FALLBACK "Use lower resolution timers" OFF)
|
|||||||
set_option(TRACY_LIBUNWIND_BACKTRACE "Use libunwind backtracing where supported" OFF)
|
set_option(TRACY_LIBUNWIND_BACKTRACE "Use libunwind backtracing where supported" OFF)
|
||||||
set_option(TRACY_SYMBOL_OFFLINE_RESOLVE "Instead of full runtime symbol resolution, only resolve the image path and offset to enable offline symbol resolution" OFF)
|
set_option(TRACY_SYMBOL_OFFLINE_RESOLVE "Instead of full runtime symbol resolution, only resolve the image path and offset to enable offline symbol resolution" OFF)
|
||||||
set_option(TRACY_LIBBACKTRACE_ELF_DYNLOAD_SUPPORT "Enable libbacktrace to support dynamically loaded elfs in symbol resolution resolution after the first symbol resolve operation" OFF)
|
set_option(TRACY_LIBBACKTRACE_ELF_DYNLOAD_SUPPORT "Enable libbacktrace to support dynamically loaded elfs in symbol resolution resolution after the first symbol resolve operation" OFF)
|
||||||
|
set_option(TRACY_DEBUGINFOD "Enable debuginfod support" OFF)
|
||||||
|
|
||||||
# advanced
|
# advanced
|
||||||
set_option(TRACY_VERBOSE "[advanced] Verbose output from the profiler" OFF)
|
set_option(TRACY_VERBOSE "[advanced] Verbose output from the profiler" OFF)
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
|
|
||||||
option(USE_DEBUGINFOD "Compile with debuginfod integration" ON)
|
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/version.cmake)
|
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/version.cmake)
|
||||||
|
|
||||||
# we target C++11 for the client part
|
# we target C++11 for the client part
|
||||||
@ -25,15 +23,9 @@ target_link_libraries(tracy-test TracyClient)
|
|||||||
|
|
||||||
# OS-specific options
|
# OS-specific options
|
||||||
|
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND USE_DEBUGINFOD)
|
|
||||||
target_compile_definitions(tracy-test PRIVATE TRACY_DEBUGINFOD)
|
|
||||||
target_link_libraries(tracy-test "debuginfod")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
|
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
|
||||||
target_link_libraries(tracy-test "execinfo")
|
target_link_libraries(tracy-test "execinfo")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
# copy image file in build folder
|
# copy image file in build folder
|
||||||
configure_file(${CMAKE_CURRENT_LIST_DIR}/image.jpg image.jpg COPYONLY)
|
configure_file(${CMAKE_CURRENT_LIST_DIR}/image.jpg image.jpg COPYONLY)
|
||||||
|
Loading…
Reference in New Issue
Block a user