Allow to opt-out from using libunwind.
This commit is contained in:
parent
53b905dcfc
commit
a1377f3451
4 changed files with 32 additions and 17 deletions
33
meson.build
33
meson.build
|
|
@ -1,7 +1,7 @@
|
||||||
project('geary', [ 'vala', 'c' ],
|
project('geary', [ 'vala', 'c' ],
|
||||||
version: '3.32-dev',
|
version: '3.32-dev',
|
||||||
license: 'LGPL2.1+',
|
license: 'LGPL2.1+',
|
||||||
meson_version: '>= 0.43',
|
meson_version: '>= 0.47',
|
||||||
)
|
)
|
||||||
|
|
||||||
gnome = import('gnome')
|
gnome = import('gnome')
|
||||||
|
|
@ -70,8 +70,8 @@ libmath = cc.find_library('m')
|
||||||
libnotify = dependency('libnotify', version: '>= 0.7.5')
|
libnotify = dependency('libnotify', version: '>= 0.7.5')
|
||||||
libsecret = dependency('libsecret-1', version: '>= 0.11')
|
libsecret = dependency('libsecret-1', version: '>= 0.11')
|
||||||
libsoup = dependency('libsoup-2.4', version: '>= 2.48')
|
libsoup = dependency('libsoup-2.4', version: '>= 2.48')
|
||||||
libunwind_dep = dependency('libunwind', version: '>= 1.1')
|
libunwind_dep = dependency('libunwind', version: '>= 1.1', required: get_option('libunwind'))
|
||||||
libunwind_generic_dep = dependency('libunwind-generic', version: '>= 1.1')
|
libunwind_generic_dep = dependency('libunwind-generic', version: '>= 1.1', required: get_option('libunwind'))
|
||||||
libxml = dependency('libxml-2.0', version: '>= 2.7.8')
|
libxml = dependency('libxml-2.0', version: '>= 2.7.8')
|
||||||
posix = valac.find_library('posix')
|
posix = valac.find_library('posix')
|
||||||
webkit2gtk_web_extension = dependency('webkit2gtk-web-extension-4.0', version: '>=' + target_webkit)
|
webkit2gtk_web_extension = dependency('webkit2gtk-web-extension-4.0', version: '>=' + target_webkit)
|
||||||
|
|
@ -81,19 +81,20 @@ if not enchant.found()
|
||||||
enchant = dependency('enchant', version: '>=1.6')
|
enchant = dependency('enchant', version: '>=1.6')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if libunwind_dep.found()
|
||||||
# Libunwind system dependencies above ensures appropriate versions,
|
# Libunwind system dependencies above ensures appropriate versions,
|
||||||
# but this declared depencency is what we actually build against so we
|
# but this declared depencency is what we actually build against so we
|
||||||
# can include the custom VAPI correctly. We need to add unwind_lib to
|
# can include the custom VAPI correctly. We need to add unwind_lib to
|
||||||
# the search path for these so Flatpak builds can find the C lib.
|
# the search path for these so Flatpak builds can find the C lib.
|
||||||
unwind_lib = libunwind_dep.get_pkgconfig_variable('libdir')
|
unwind_lib = libunwind_dep.get_pkgconfig_variable('libdir')
|
||||||
libunwind = declare_dependency(
|
libunwind = declare_dependency(
|
||||||
dependencies: [
|
dependencies: [
|
||||||
valac.find_library('libunwind', dirs: [vapi_dir, unwind_lib]),
|
valac.find_library('libunwind', dirs: [vapi_dir, unwind_lib]),
|
||||||
cc.find_library('libunwind', dirs: unwind_lib),
|
cc.find_library('libunwind', dirs: unwind_lib),
|
||||||
cc.find_library('libunwind-generic', dirs: unwind_lib)
|
cc.find_library('libunwind-generic', dirs: unwind_lib)
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
endif
|
||||||
|
|
||||||
# Optional libraries
|
# Optional libraries
|
||||||
libunity = dependency('unity', version: '>= 5.12.0', required: false)
|
libunity = dependency('unity', version: '>= 5.12.0', required: false)
|
||||||
|
|
|
||||||
|
|
@ -4,3 +4,4 @@ option('poodle', type: 'boolean', value: true, description: 'Whether to apply th
|
||||||
option('ref_tracking', type: 'boolean', value: false, description: 'Whether to use explicit reference tracking.')
|
option('ref_tracking', type: 'boolean', value: false, description: 'Whether to use explicit reference tracking.')
|
||||||
option('iso_639_xml', type: 'string', value: '', description: 'Full path to the ISO 639 XML file.')
|
option('iso_639_xml', type: 'string', value: '', description: 'Full path to the ISO 639 XML file.')
|
||||||
option('iso_3166_xml', type: 'string', value: '', description: 'Full path to the ISO 3166 XML file.')
|
option('iso_3166_xml', type: 'string', value: '', description: 'Full path to the ISO 3166 XML file.')
|
||||||
|
option('libunwind', type: 'feature', value: 'enabled', description: 'Whether to use libunwind.')
|
||||||
|
|
|
||||||
|
|
@ -332,12 +332,15 @@ geary_engine_dependencies = [
|
||||||
glib,
|
glib,
|
||||||
gmime,
|
gmime,
|
||||||
javascriptcoregtk,
|
javascriptcoregtk,
|
||||||
libunwind,
|
|
||||||
libxml,
|
libxml,
|
||||||
posix,
|
posix,
|
||||||
sqlite
|
sqlite
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if libunwind_dep.found()
|
||||||
|
geary_engine_dependencies += libunwind
|
||||||
|
endif
|
||||||
|
|
||||||
build_dir = meson.current_build_dir()
|
build_dir = meson.current_build_dir()
|
||||||
|
|
||||||
# Generate internal VAPI for unit testing. See Meson issue
|
# Generate internal VAPI for unit testing. See Meson issue
|
||||||
|
|
@ -349,6 +352,12 @@ geary_engine_vala_options += [
|
||||||
'--internal-vapi=@0@/geary-engine-internal.vapi'.format(build_dir)
|
'--internal-vapi=@0@/geary-engine-internal.vapi'.format(build_dir)
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if libunwind_dep.found()
|
||||||
|
geary_engine_vala_options += [
|
||||||
|
'-D', 'HAVE_LIBUNWIND',
|
||||||
|
]
|
||||||
|
endif
|
||||||
|
|
||||||
geary_engine_lib = static_library('geary-engine',
|
geary_engine_lib = static_library('geary-engine',
|
||||||
geary_engine_sources,
|
geary_engine_sources,
|
||||||
dependencies: geary_engine_dependencies,
|
dependencies: geary_engine_dependencies,
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ public class Geary.ErrorContext : BaseObject {
|
||||||
public string name = "unknown";
|
public string name = "unknown";
|
||||||
|
|
||||||
|
|
||||||
|
#if HAVE_LIBUNWIND
|
||||||
internal StackFrame(Unwind.Cursor frame) {
|
internal StackFrame(Unwind.Cursor frame) {
|
||||||
uint8 proc_name[256];
|
uint8 proc_name[256];
|
||||||
int ret = -frame.get_proc_name(proc_name);
|
int ret = -frame.get_proc_name(proc_name);
|
||||||
|
|
@ -36,6 +37,7 @@ public class Geary.ErrorContext : BaseObject {
|
||||||
this.name = (string) proc_name;
|
this.name = (string) proc_name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
public string to_string() {
|
public string to_string() {
|
||||||
return this.name;
|
return this.name;
|
||||||
|
|
@ -56,6 +58,7 @@ public class Geary.ErrorContext : BaseObject {
|
||||||
public ErrorContext(GLib.Error thrown) {
|
public ErrorContext(GLib.Error thrown) {
|
||||||
this.thrown = thrown;
|
this.thrown = thrown;
|
||||||
|
|
||||||
|
#if HAVE_LIBUNWIND
|
||||||
Unwind.Context trace = Unwind.Context();
|
Unwind.Context trace = Unwind.Context();
|
||||||
Unwind.Cursor cursor = Unwind.Cursor.local(trace);
|
Unwind.Cursor cursor = Unwind.Cursor.local(trace);
|
||||||
|
|
||||||
|
|
@ -64,6 +67,7 @@ public class Geary.ErrorContext : BaseObject {
|
||||||
while (cursor.step() != 0) {
|
while (cursor.step() != 0) {
|
||||||
this.backtrace.add(new StackFrame(cursor));
|
this.backtrace.add(new StackFrame(cursor));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Returns a string representation of the error type, for debugging. */
|
/** Returns a string representation of the error type, for debugging. */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue