Fix build options, add TRACY_TIMER_FALLBACK option.

Renamed TRACY_NO_SYS_TRACE -> TRACY_NO_SYSTEM_TRACING to match the
build flag name. Unlike the meson logic, the CMake logic directly
maps the option name to the build flag that is injected. With the
mismatched name, the flag wasn't being properly applied.

Added TRACY_TIMER_FALLBACK option to expose the same-named flag.

Moved signal.h include to get sigaction definition that was missing when
TRACY_NO_CALLSTACK was defined.
This commit is contained in:
Michael Puskas 2022-05-01 13:51:22 -07:00
parent aa2bbfe5f9
commit a5ea07f107
4 changed files with 11 additions and 3 deletions

View File

@ -49,11 +49,12 @@ set_option(TRACY_NO_SAMPLING "Disable call stack sampling" OFF)
set_option(TRACY_NO_VERIFY "Disable zone validation for C API" OFF)
set_option(TRACY_NO_VSYNC_CAPTURE "Disable capture of hardware Vsync events" OFF)
set_option(TRACY_NO_FRAME_IMAGE "Disable the frame image support and its thread" OFF)
set_option(TRACY_NO_SYS_TRACE "Disable systrace sampling" OFF)
set_option(TRACY_NO_SYSTEM_TRACING "Disable systrace sampling" OFF)
set_option(TRACY_DELAYED_INIT "Enable delayed initialization of the library (init on first call)" OFF)
set_option(TRACY_MANUAL_LIFETIME "Enable the manual lifetime management of the profile" OFF)
set_option(TRACY_FIBERS "Enable fibers support" OFF)
set_option(TRACY_NO_CRASH_HANDLER, "Disable crash handling" OFF)
set_option(TRACY_TIMER_FALLBACK "Use lower resolution timers" OFF)
if(BUILD_SHARED_LIBS)
target_compile_definitions(TracyClient PRIVATE TRACY_EXPORTS)

View File

@ -21,7 +21,6 @@
#ifdef __linux__
# include <dirent.h>
# include <signal.h>
# include <pthread.h>
# include <sys/types.h>
# include <sys/syscall.h>

View File

@ -30,6 +30,10 @@
# define TRACY_HW_TIMER
#endif
#ifdef __linux__
# include <signal.h>
#endif
#if defined TRACY_TIMER_FALLBACK || !defined TRACY_HW_TIMER
# include <chrono>
#endif

View File

@ -60,7 +60,7 @@ if get_option('tracy_no_frame_image')
add_project_arguments('-DTRACY_NO_FRAME_IMAGE', language : 'cpp')
endif
if get_option('tracy_no_sys_trace')
if get_option('tracy_no_system_tracing')
add_project_arguments('-DTRACY_NO_SYSTEM_TRACING', language : 'cpp')
endif
@ -76,6 +76,10 @@ if get_option('tracy_fibers')
add_project_arguments('-DTRACY_FIBERS', language : 'cpp')
endif
if get_option('tracy_timer_fallback')
add_project_arguments('-DTRACY_TIMER_FALLBACK', language : 'cpp')
endif
tracy_shared_libs = get_option('tracy_shared_libs')
if tracy_shared_libs
add_project_arguments('-DTRACY_EXPORTS', language : 'cpp')