From d9a182b4501fea8157b541de5bcd8c82b72189fa Mon Sep 17 00:00:00 2001 From: Alberto Luaces Date: Tue, 23 Jul 2024 12:15:36 +0200 Subject: [PATCH] Find libunwind if requested so we can link to it. --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 358266c0..8ad7dfd7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,6 +47,13 @@ if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") target_link_libraries(TracyClient PUBLIC ${EXECINFO_LIBRARY}) endif() +if(TRACY_LIBUNWIND_BACKTRACE) + include(FindPkgConfig) + pkg_check_modules(unwind REQUIRED libunwind) + target_include_directories(TracyClient INTERFACE ${unwind_INCLUDE_DIRS}) + target_link_libraries(TracyClient INTERFACE ${unwind_LINK_LIBRARIES}) +endif() + add_library(Tracy::TracyClient ALIAS TracyClient) macro(set_option option help value)