[babl] build: improve gir build - change build option to auto/true/false - auto=false if cross build true o



commit 2f438314d810e3aafdd71be6a6d9a36d8b5c6918
Author: John Marshall <jtm home gmail com>
Date:   Wed May 20 15:10:10 2020 +0100

    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 c9f62ce33..4b6fff49b 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 4b40419d8..071cbcd9b 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 442eb6563..fe186624d 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',


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]