summaryrefslogtreecommitdiff
path: root/indra/cmake/Tracy.cmake
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2024-08-31 21:25:47 +0800
committerErik Kundiman <erik@megapahit.org>2024-09-01 20:43:42 +0800
commit95582654e49422d51b55665c3f2821c848ad1cb8 (patch)
treed6d03a887b8e1b6c3be1b139d63b1638c5d0fdcd /indra/cmake/Tracy.cmake
parentab3f483a3e5ed213882a83b882095cfdb6a4de57 (diff)
parentb0fefd62adbf51f32434ba077e9f52d8a9241d15 (diff)
Merge remote-tracking branch 'secondlife/release/2024.08-DeltaFPS' into 2024.08-DeltaFPS
Diffstat (limited to 'indra/cmake/Tracy.cmake')
-rw-r--r--indra/cmake/Tracy.cmake22
1 files changed, 20 insertions, 2 deletions
diff --git a/indra/cmake/Tracy.cmake b/indra/cmake/Tracy.cmake
index 32c02edb93..d54a32fdc2 100644
--- a/indra/cmake/Tracy.cmake
+++ b/indra/cmake/Tracy.cmake
@@ -4,14 +4,32 @@ include(Prebuilt)
include_guard()
add_library( ll::tracy INTERFACE IMPORTED )
-set(USE_TRACY OFF CACHE BOOL "Use Tracy profiler.")
+# default Tracy profiling on for test builds, but off for all others
+string(TOLOWER ${VIEWER_CHANNEL} channel_lower)
+if(WINDOWS AND channel_lower MATCHES "^second life test")
+ option(USE_TRACY "Use Tracy profiler." ON)
+else()
+ option(USE_TRACY "Use Tracy profiler." OFF)
+endif()
if (USE_TRACY)
+ option(USE_TRACY_ON_DEMAND "Use on-demand Tracy profiling." ON)
+ option(USE_TRACY_LOCAL_ONLY "Disallow remote Tracy profiling." OFF)
+
use_system_binary(tracy)
use_prebuilt_binary(tracy)
target_include_directories( ll::tracy SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/tracy)
- target_link_libraries( ll::tracy INTERFACE TracyClient )
+
+ target_compile_definitions(ll::tracy INTERFACE -DTRACY_ENABLE=1 -DTRACY_ONLY_IPV4=1)
+
+ if (USE_TRACY_ON_DEMAND)
+ target_compile_definitions(ll::tracy INTERFACE -DTRACY_ON_DEMAND=1)
+ endif ()
+
+ if (USE_TRACY_LOCAL_ONLY)
+ target_compile_definitions(ll::tracy INTERFACE -DTRACY_NO_BROADCAST=1 -DTRACY_ONLY_LOCALHOST=1)
+ endif ()
# See: indra/llcommon/llprofiler.h
add_compile_definitions(LL_PROFILER_CONFIGURATION=3)