diff options
author | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2017-12-08 16:32:42 +0100 |
---|---|---|
committer | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2017-12-08 16:32:42 +0100 |
commit | d67a890d4cfff63eca50bcdd08fd506c05a0e897 (patch) | |
tree | 8661f91d90793a303691485649821242930ac9f3 | |
parent | 4ca3594343548254358b84e029c3d984a8ac8016 (diff) |
meson: add option to not build introspectiond data
-rw-r--r-- | meson_options.txt | 6 | ||||
-rw-r--r-- | ufo/meson.build | 28 |
2 files changed, 21 insertions, 13 deletions
diff --git a/meson_options.txt b/meson_options.txt index 3e8c24c..17ac30b 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,3 +1,7 @@ option('gtk_doc', type: 'boolean', value: false, - description: 'Whether to generate API references for Ufo') + description: 'Build API references (requires gtk-doc)') + +option('introspection', + type: 'boolean', value: true, + description: 'Build introspection data (requires gobject-introspection') diff --git a/ufo/meson.build b/ufo/meson.build index 376d993..22a297c 100644 --- a/ufo/meson.build +++ b/ufo/meson.build @@ -105,18 +105,22 @@ lib_dep = declare_dependency( dependencies: deps + [m_dep] ) -gnome.generate_gir(lib, - namespace: 'Ufo', - nsversion: '@0@.0'.format(version_major), - sources: sources + headers, - install: true, - includes: [ - 'GLib-2.0', - 'GObject-2.0', - 'GModule-2.0', - 'Json-1.0', - ], -) +gir = find_program('g-ir-scanner', required: false) + +if gir.found() and get_option('introspection') + gnome.generate_gir(lib, + namespace: 'Ufo', + nsversion: '@0@.0'.format(version_major), + sources: sources + headers, + install: true, + includes: [ + 'GLib-2.0', + 'GObject-2.0', + 'GModule-2.0', + 'Json-1.0', + ], + ) +endif pkg = import('pkgconfig') |