From 9791669ac32c5fe23ca1b07a623b49ec187537a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Tue, 27 Sep 2016 18:00:47 +0100 Subject: [PATCH] meson: tracers: signal availability of libunwind and backtrace() to code Not setting cdata here on purpose because of .. complications. --- meson.build | 1 - plugins/tracers/meson.build | 13 ++++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index e2f87036f2..c6f575bc56 100644 --- a/meson.build +++ b/meson.build @@ -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 diff --git a/plugins/tracers/meson.build b/plugins/tracers/meson.build index 6f7f9cc83b..4ca273359a 100644 --- a/plugins/tracers/meson.build +++ b/plugins/tracers/meson.build @@ -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 ') + 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,