Skip to content

Commit

Permalink
Merge pull request #956 from foxtran/fix/incompatible-MANUAL_LIFETIME
Browse files Browse the repository at this point in the history
Generate human-readable errors when TRACY_MANUAL_LIFETIME is set and TRACT_DELAYED_INIT is not
  • Loading branch information
wolfpld authored Dec 27, 2024
2 parents 6452690 + caf0047 commit 57f1a63
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ mark_as_advanced(TRACY_VERBOSE)
set_option(TRACY_DEMANGLE "[advanced] Don't use default demangling function - You'll need to provide your own" OFF)
mark_as_advanced(TRACY_DEMANGLE)

# handle incompatible combinations
if(TRACY_MANUAL_LIFETIME AND NOT TRACY_DELAYED_INIT)
message(FATAL_ERROR "TRACY_MANUAL_LIFETIME can not be activated with disabled TRACY_DELAYED_INIT")
endif()

if(NOT TRACY_STATIC)
target_compile_definitions(TracyClient PRIVATE TRACY_EXPORTS)
target_compile_definitions(TracyClient PUBLIC TRACY_IMPORTS)
Expand Down
6 changes: 5 additions & 1 deletion public/client/TracyProfiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@
#include "TracySysTrace.hpp"
#include "../tracy/TracyC.h"

#if defined TRACY_MANUAL_LIFETIME && !defined(TRACY_DELAYED_INIT)
# error "TRACY_MANUAL_LIFETIME requires enabled TRACY_DELAYED_INIT"
#endif

#ifdef TRACY_PORT
# ifndef TRACY_DATA_PORT
# define TRACY_DATA_PORT TRACY_PORT
Expand Down Expand Up @@ -4907,7 +4911,7 @@ TRACY_API void ___tracy_fiber_enter( const char* fiber ){ tracy::Profiler::Enter
TRACY_API void ___tracy_fiber_leave( void ){ tracy::Profiler::LeaveFiber(); }
#endif

# ifdef TRACY_MANUAL_LIFETIME
# if defined TRACY_MANUAL_LIFETIME && defined TRACY_DELAYED_INIT
TRACY_API void ___tracy_startup_profiler( void )
{
tracy::StartupProfiler();
Expand Down

0 comments on commit 57f1a63

Please sign in to comment.