Skip to content

Commit

Permalink
Add option to disable building introspection and vala bindings. (#184)
Browse files Browse the repository at this point in the history
  • Loading branch information
SparkyBluefang authored Sep 2, 2024
1 parent 4ffed1b commit 70bd3a9
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 17 deletions.
38 changes: 22 additions & 16 deletions libxapp/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -119,16 +119,18 @@ libxapp_dep = declare_dependency(
sources: [ xapp_headers, dbus_headers ]
)

gir = gnome.generate_gir(libxapp,
namespace: 'XApp',
nsversion: '1.0',
sources: xapp_headers + xapp_sources + dbus_headers + xapp_enums,
identifier_prefix: 'XApp',
symbol_prefix: 'xapp_',
export_packages: 'xapp',
includes: ['GObject-2.0', 'Gtk-3.0'],
install: true
)
if get_option('introspection')
gir = gnome.generate_gir(libxapp,
namespace: 'XApp',
nsversion: '1.0',
sources: xapp_headers + xapp_sources + dbus_headers + xapp_enums,
identifier_prefix: 'XApp',
symbol_prefix: 'xapp_',
export_packages: 'xapp',
includes: ['GObject-2.0', 'Gtk-3.0'],
install: true
)
endif

pkg.generate(
libraries: libxapp,
Expand All @@ -144,12 +146,16 @@ install_data(['xapp-glade-catalog.xml'],
install_dir : join_paths(get_option('datadir'), 'glade/catalogs')
)

gnome.generate_vapi('xapp',
packages: ['glib-2.0', 'gio-unix-2.0', 'gtk+-3.0'],
sources: gir[0],
metadata_dirs: meson.current_source_dir(),
install: true
)
if get_option('vapi')
assert(is_variable('gir'), 'vapi requires introspection to be enabled')

gnome.generate_vapi('xapp',
packages: ['glib-2.0', 'gio-unix-2.0', 'gtk+-3.0'],
sources: gir[0],
metadata_dirs: meson.current_source_dir(),
install: true
)
endif

if not app_lib_only
gtk3_module = shared_module(
Expand Down
5 changes: 4 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ top_inc = include_directories('.')
subdir('libxapp')
subdir('po')
subdir('schemas')
subdir('pygobject')

if get_option('introspection')
subdir('pygobject')
endif

if not app_lib_only
subdir('icons')
Expand Down
10 changes: 10 additions & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,13 @@ option('xfce',
value: true,
description: 'Install xfce specific items.'
)
option('introspection',
type: 'boolean',
value: true,
description: 'Enable GObject Introspection.'
)
option('vapi',
type: 'boolean',
value: true,
description: 'Enable Vala bindings.'
)

0 comments on commit 70bd3a9

Please sign in to comment.