From 995866a5760a7c2f15804f39d19da0fbd38de22f Mon Sep 17 00:00:00 2001 From: Ryan Pavlik Date: Tue, 18 May 2021 11:39:41 -0500 Subject: [PATCH] cmake: Improve use of percetto --- CMakeLists.txt | 2 +- src/xrt/auxiliary/CMakeLists.txt | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 746dc5f27..e5746f41e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -145,7 +145,7 @@ endforeach() option(BUILD_TESTING "Enable building of the test suite?" ON) option(XRT_FEATURE_COLOR_LOG "Enable logging in color on supported platforms" ON) -option(XRT_FEATURE_TRACING "Enable debug tracing on supported platforms" OFF) +cmake_dependent_option(XRT_FEATURE_TRACING "Enable debug tracing on supported platforms" OFF "XRT_HAVE_PERCETTO" OFF) cmake_dependent_option(CMAKE_INTERPROCEDURAL_OPTIMIZATION "Enable inter-procedural (link-time) optimization" OFF "HAS_IPO" OFF) cmake_dependent_option(XRT_HAVE_WAYLAND "Enable Wayland support" ON "WAYLAND_FOUND AND WAYLAND_SCANNER_FOUND AND WAYLAND_PROTOCOLS_FOUND AND LIBDRM_FOUND" OFF) diff --git a/src/xrt/auxiliary/CMakeLists.txt b/src/xrt/auxiliary/CMakeLists.txt index 62aa98074..93c3ac9c8 100644 --- a/src/xrt/auxiliary/CMakeLists.txt +++ b/src/xrt/auxiliary/CMakeLists.txt @@ -242,9 +242,8 @@ else() target_link_libraries(aux_util PUBLIC xrt-external-cjson) endif() # For u_trace_marker -if(XRT_HAVE_PERCETTO) - target_link_libraries(aux_util PRIVATE ${PERCETTO_LINK_LIBRARIES}) - target_include_directories(aux_util PUBLIC ${PERCETTO_INCLUDE_DIRS}) +if(XRT_FEATURE_TRACING AND XRT_HAVE_PERCETTO) + target_link_libraries(aux_util PUBLIC Percetto::percetto) endif() if(XRT_HAVE_LIBBSD) target_include_directories(aux_util SYSTEM PRIVATE ${LIBBSD_INCLUDE_DIRS})