meson: tracers: signal availability of libunwind and backtrace() to code

Not setting cdata here on purpose because of .. complications.
This commit is contained in:
Tim-Philipp Müller 2016-09-27 18:00:47 +01:00
parent c4aed66eff
commit 9791669ac3
2 changed files with 12 additions and 2 deletions

View file

@ -249,7 +249,6 @@ if host_machine.system() == 'windows'
else
gio_dep = [dependency('gio-2.0'), dependency('gio-unix-2.0')]
endif
unwind_dep = dependency('libunwind', required : false)
mathlib = cc.find_library('m', required : false)
rt_lib = cc.find_library('rt', required : false) # clock_gettime

View file

@ -10,9 +10,20 @@ if have_getrusage
gst_tracers_sources += ['gstrusage.c']
endif
tracers_args = gst_c_args + ['-DGST_USE_UNSTABLE_API']
unwind_dep = dependency('libunwind', required : false)
if unwind_dep.found()
tracers_args += ['-DHAVE_UNWIND']
endif
if cc.has_header('execinfo.h') and cc.has_function('backtrace', prefix : '#include <execinfo.h>')
tracers_args += ['-DHAVE_BACKTRACE']
endif
gst_tracers = library('gstcoretracers',
gst_tracers_sources,
c_args : gst_c_args + ['-DGST_USE_UNSTABLE_API'],
c_args : tracers_args,
include_directories : [configinc],
dependencies : [gst_dep, unwind_dep],
link_with : printf_lib,