From 20ee2e533794e0d5a3437e5b272da0a648d73c3e Mon Sep 17 00:00:00 2001 From: Corey Halpin Date: Wed, 8 Mar 2023 19:54:16 -0600 Subject: Add atk_only option to enable building a stub atk library When built with atk_only, a stub library will be produced that can be used to satisfy package dependencies but provides no functionality. --- meson.build | 40 ++++++++++++++++++++++++---------------- meson_options.txt | 4 ++++ 2 files changed, 28 insertions(+), 16 deletions(-) diff --git a/meson.build b/meson.build index c83059fd..d938e093 100644 --- a/meson.build +++ b/meson.build @@ -127,7 +127,10 @@ gmodule_req_version = '>= 2.0.0' gio_req_version = '>= 2.28.0' libxml_req_version = '>= 2.9.1' -libdbus_dep = dependency('dbus-1', version: libdbus_req_version) +if not get_option('atk_only') + libdbus_dep = dependency('dbus-1', version: libdbus_req_version) +endif + glib_dep = dependency('glib-2.0', version: glib_req_version) gobject_dep = dependency('gobject-2.0', version: gobject_req_version) gio_dep = dependency('gio-2.0', version: gio_req_version) @@ -166,10 +169,12 @@ dbus_alignments = [ 'dbus_int64_t', ] -foreach a: dbus_alignments - at_spi_conf.set('ALIGNOF_' + a.underscorify().to_upper(), - cc.alignment(a, prefix: '#include ', dependencies: libdbus_dep)) -endforeach +if not get_option('atk_only') + foreach a: dbus_alignments + at_spi_conf.set('ALIGNOF_' + a.underscorify().to_upper(), + cc.alignment(a, prefix: '#include ', dependencies: libdbus_dep)) + endforeach +endif at_spi_conf.set('ALIGNOF_DBIND_POINTER', cc.alignment('dbind_pointer', prefix: 'typedef void *dbind_pointer;')) at_spi_conf.set('ALIGNOF_DBIND_STRUCT', cc.alignment('dbind_struct', prefix: 'typedef struct { char s1; } dbind_struct;')) @@ -191,18 +196,21 @@ else p2p_cflags = [] endif -install_data('at-spi2-atk.desktop', - install_dir: join_paths(get_option('libdir'), 'gnome-settings-daemon-3.0', 'gtk-modules')) - -subdir('xml') -subdir('dbind') -subdir('atspi') -subdir('bus') -subdir('registryd') subdir('atk') -subdir('droute') -subdir('atk-adaptor') -subdir('tests') + +if not get_option('atk_only') + install_data('at-spi2-atk.desktop', + install_dir: join_paths(get_option('libdir'), 'gnome-settings-daemon-3.0', 'gtk-modules')) + + subdir('xml') + subdir('dbind') + subdir('atspi') + subdir('bus') + subdir('registryd') + subdir('droute') + subdir('atk-adaptor') + subdir('tests') +endif if get_option('docs') subdir('doc') diff --git a/meson_options.txt b/meson_options.txt index 11cde7bc..548cdf7e 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -36,3 +36,7 @@ option('disable_p2p', description: 'Disable peer-to-peer DBus connections for at-spi2-atk', type: 'boolean', value: false) +option('atk_only', + description: 'Build only the ATK stub library without atspi or at-spi2-atk (UNSUPPORTED)', + type: 'boolean', + value: false) -- cgit v1.2.1