From bed3076bc6146ec3ed6ba404655ce0bd06173566 Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Tue, 26 Jun 2018 15:40:33 +0200 Subject: meson: allow disabling introspection generation --- meson_options.txt | 3 +++ src/meson.build | 26 +++++++++++++++----------- 2 files changed, 18 insertions(+), 11 deletions(-) create mode 100644 meson_options.txt diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 0000000..ba31140 --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,3 @@ +option('introspection', + type: 'boolean', value: true, + description: 'Build introspection data (requires gobject-introspection') diff --git a/src/meson.build b/src/meson.build index 5bd5509..2a3f8da 100644 --- a/src/meson.build +++ b/src/meson.build @@ -43,17 +43,21 @@ lib = library('uca', install: true, ) -gnome.generate_gir(lib, - namespace: 'Uca', - nsversion: '@0@.0'.format(version_major), - sources: sources + headers, - install: true, - includes: [ - 'GLib-2.0', - 'GObject-2.0', - 'GModule-2.0', - ], -) +gir = find_program('g-ir-scanner', required: false) + +if gir.found() and get_option('introspection') + gnome.generate_gir(lib, + namespace: 'Uca', + nsversion: '@0@.0'.format(version_major), + sources: sources + headers, + install: true, + includes: [ + 'GLib-2.0', + 'GObject-2.0', + 'GModule-2.0', + ], + ) +endif pkg = import('pkgconfig') -- cgit v1.2.3