From 2f438314d810e3aafdd71be6a6d9a36d8b5c6918 Mon Sep 17 00:00:00 2001 From: John Marshall Date: Wed, 20 May 2020 15:10:10 +0100 Subject: [PATCH] build: improve gir build - change build option to auto/true/false - auto=false if cross build true otherwise --- babl/meson.build | 2 +- meson.build | 6 ++++++ meson_options.txt | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/babl/meson.build b/babl/meson.build index c9f62ce..4b6fff4 100644 --- a/babl/meson.build +++ b/babl/meson.build @@ -145,7 +145,7 @@ babl = library( install: true, ) -if get_option('enable-gir') +if build_gir # identity filter, so GIR doesn't choke on the Babl type # (since it has the same name as the Babl namespace) identfilter_py = join_paths(meson.current_source_dir(), 'identfilter.py') diff --git a/meson.build b/meson.build index 4b40419..071cbcd 100644 --- a/meson.build +++ b/meson.build @@ -365,6 +365,12 @@ elif get_option('with-docs') == 'false' build_docs = false endif +# Introspection - don't build by default on cross-build environments +if get_option('enable-gir') == 'auto' + build_gir = meson.is_cross_build() ? false : true +else + build_gir = get_option('enable-gir') == 'true' ? true : false +endif ################################################################################ # Configuration files diff --git a/meson_options.txt b/meson_options.txt index 442eb65..fe18662 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -5,8 +5,8 @@ option('with-docs', description: 'build documentation' ) option('enable-gir', - type: 'boolean', - value: 'true', + type: 'combo', + choices: ['auto', 'true', 'false'], description: 'gobject introspection .gir generation' ) option('enable-vapi', -- 2.30.2