From d6dba3fd6fa84bd24705ca72da824edc4af989e7 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Mon, 13 Feb 2017 15:18:59 -0300 Subject: [PATCH] meson: Add an option to disable usage of libunwind Fixes https://bugzilla.gnome.org/show_bug.cgi?id=778193 --- gst/meson.build | 6 +++--- meson.build | 30 +++++++++++++++++------------- meson_options.txt | 3 +++ 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/gst/meson.build b/gst/meson.build index aa8dd93..1cd8815 100644 --- a/gst/meson.build +++ b/gst/meson.build @@ -196,7 +196,7 @@ if libtype != 'shared' include_directories('parse')], install : true, link_with : printf_lib, - dependencies : [gobject_dep, gmodule_dep, glib_dep, mathlib, unwind_dep, dw_dep] + platform_deps, + dependencies : [gobject_dep, gmodule_dep, glib_dep, mathlib] + backtrace_deps + platform_deps, ) libgst = libgst_static endif @@ -215,8 +215,8 @@ if libtype != 'static' include_directories('parse')], link_with : printf_lib, install : true, - dependencies : [gobject_dep, gmodule_dep, glib_dep, mathlib, dl_dep, - unwind_dep, dw_dep] + platform_deps, + dependencies : [gobject_dep, gmodule_dep, glib_dep, mathlib, dl_dep] + backtrace_deps + + platform_deps, vs_module_defs: vs_module_defs_dir + 'libgstreamer.def', ) libgst = libgst_shared diff --git a/meson.build b/meson.build index 9f4476c..e7d219b 100644 --- a/meson.build +++ b/meson.build @@ -275,20 +275,24 @@ if host_machine.system() == 'windows' platform_deps = [cc.find_library('ws2_32')] endif -unwind_dep = dependency('libunwind', required : false) -dw_dep = dependency('libdw', required: false) -if unwind_dep.found() - cdata.set('HAVE_UNWIND', 1) - if dw_dep.found() - cdata.set('HAVE_DW', 1) - else - message('Support for backtraces is partial only.') - endif -else - if cc.has_function('backtrace') - cdata.set('HAVE_BACKTRACE', 1) +backtrace_deps = [] +if not get_option('disable_libunwind') + unwind_dep = dependency('libunwind', required : false) + dw_dep = dependency('libdw', required: false) + backtrace_deps = [unwind_dep, dw_dep] + if unwind_dep.found() + cdata.set('HAVE_UNWIND', 1) + if dw_dep.found() + cdata.set('HAVE_DW', 1) + else + message('Support for backtraces is partial only.') + endif else - message('NO backtraces support.') + if cc.has_function('backtrace') + cdata.set('HAVE_BACKTRACE', 1) + else + message('NO backtraces support.') + endif endif endif diff --git a/meson_options.txt b/meson_options.txt index 190fe1b..9bc0e29 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -8,3 +8,6 @@ option('library_format', type : 'combo', choices : ['shared', 'static', 'both'], option('disable_introspection', type : 'boolean', value : false, description : 'Whether to disable the introspection generation') +option('disable_libunwind', + type : 'boolean', value : false, + description : 'Whether to disable the usage of libunwind (to generate backtraces)') -- 2.7.4