Merge pull request #683 from YaLTeR/add-missing-to-meson

Add new options to meson
This commit is contained in:
Bartosz Taudul 2023-12-12 12:52:33 +01:00 committed by GitHub
commit ea53a9220b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 4 deletions

View File

@ -6,6 +6,9 @@ tracy_compile_args = []
# compiler flags shared between the capture library itself and the code using it # compiler flags shared between the capture library itself and the code using it
tracy_common_args = [] tracy_common_args = []
# dependencies that will be propagated to the users of the capture library
tracy_public_deps = []
if get_option('tracy_enable') if get_option('tracy_enable')
tracy_common_args += ['-DTRACY_ENABLE'] tracy_common_args += ['-DTRACY_ENABLE']
endif endif
@ -94,6 +97,19 @@ if get_option('tracy_no_crash_handler')
tracy_common_args += ['-DTRACY_NO_CRASH_HANDLER'] tracy_common_args += ['-DTRACY_NO_CRASH_HANDLER']
endif endif
if get_option('tracy_libunwind_backtrace')
tracy_common_args += ['-DTRACE_CLIENT_LIBUNWIND_BACKTRACE']
tracy_public_deps += dependency('libunwind')
endif
if get_option('tracy_symbol_offline_resolve')
tracy_compile_args += ['-DTRACY_SYMBOL_OFFLINE_RESOLVE']
endif
if get_option('tracy_libbacktrace_elf_dynload_support')
tracy_compile_args += ['-DTRACY_LIBBACKTRACE_ELF_DYNLOAD_SUPPORT']
endif
tracy_shared_libs = get_option('default_library') == 'shared' tracy_shared_libs = get_option('default_library') == 'shared'
if not tracy_shared_libs and get_option('tracy_shared_libs') if not tracy_shared_libs and get_option('tracy_shared_libs')
warning('tracy_shared_libs is set to true, but default_library is set to static. Building static library.') warning('tracy_shared_libs is set to true, but default_library is set to static. Building static library.')
@ -103,8 +119,6 @@ if tracy_shared_libs
tracy_compile_args += ['-DTRACY_EXPORTS'] tracy_compile_args += ['-DTRACY_EXPORTS']
endif endif
threads_dep = dependency('threads')
if host_machine.system() == 'windows' if host_machine.system() == 'windows'
tracy_compile_args += ['-DWINVER=0x0601', '-D_WIN32_WINNT=0x0601'] tracy_compile_args += ['-DWINVER=0x0601', '-D_WIN32_WINNT=0x0601']
endif endif
@ -175,8 +189,10 @@ endif
tracy_compile_args += tracy_common_args tracy_compile_args += tracy_common_args
tracy_deps = [dependency('threads')] + tracy_public_deps
tracy = library('tracy', tracy_src, tracy_header_files, tracy = library('tracy', tracy_src, tracy_header_files,
dependencies : [ threads_dep ], dependencies : tracy_deps,
include_directories : tracy_public_include_dirs, include_directories : tracy_public_include_dirs,
cpp_args : tracy_compile_args, cpp_args : tracy_compile_args,
override_options : override_options, override_options : override_options,
@ -193,7 +209,9 @@ if tracy_shared_libs
endif endif
pkg = import('pkgconfig') pkg = import('pkgconfig')
pkg.generate(tracy, extra_cflags: tracy_dep_compile_args) pkg.generate(tracy,
extra_cflags : tracy_dep_compile_args,
requires : tracy_public_deps)
tracy_dep = declare_dependency( tracy_dep = declare_dependency(
compile_args : tracy_dep_compile_args, compile_args : tracy_dep_compile_args,

View File

@ -16,6 +16,9 @@ option('tracy_no_frame_image', type : 'boolean', value : false, description : 'D
option('tracy_no_system_tracing', type : 'boolean', value : false, description : 'Disable systrace sampling') option('tracy_no_system_tracing', type : 'boolean', value : false, description : 'Disable systrace sampling')
option('tracy_patchable_nopsleds', type : 'boolean', value : false, description : 'Enable nopsleds for efficient patching by system-level tools (e.g. rr)') option('tracy_patchable_nopsleds', type : 'boolean', value : false, description : 'Enable nopsleds for efficient patching by system-level tools (e.g. rr)')
option('tracy_timer_fallback', type : 'boolean', value : false, description : 'Use lower resolution timers') option('tracy_timer_fallback', type : 'boolean', value : false, description : 'Use lower resolution timers')
option('tracy_libunwind_backtrace', type : 'boolean', value : false, description : 'Use libunwind backtracing where supported')
option('tracy_symbol_offline_resolve', type : 'boolean', value : false, description : 'Instead of full runtime symbol resolution, only resolve the image path and offset to enable offline symbol resolution')
option('tracy_libbacktrace_elf_dynload_support', type : 'boolean', value : false, description : 'Enable libbacktrace to support dynamically loaded elfs in symbol resolution resolution after the first symbol resolve operation')
option('tracy_delayed_init', type : 'boolean', value : false, description : 'Enable delayed initialization of the library (init on first call)') option('tracy_delayed_init', type : 'boolean', value : false, description : 'Enable delayed initialization of the library (init on first call)')
option('tracy_manual_lifetime', type : 'boolean', value : false, description : 'Enable the manual lifetime management of the profile') option('tracy_manual_lifetime', type : 'boolean', value : false, description : 'Enable the manual lifetime management of the profile')
option('tracy_fibers', type : 'boolean', value : false, description : 'Enable fibers support') option('tracy_fibers', type : 'boolean', value : false, description : 'Enable fibers support')