build: improve gir build
authorJohn Marshall <jtm.home@gmail.com>
Wed, 20 May 2020 14:10:10 +0000 (15:10 +0100)
committerJohn Marshall <jtm.home@gmail.com>
Thu, 25 Jun 2020 07:06:47 +0000 (08:06 +0100)
- change build option to auto/true/false
- auto=false if cross build true otherwise

babl/meson.build
meson.build
meson_options.txt

index c9f62ce33ca461cc1fda8a5bc7474f0e47da43bf..4b6fff49be559e247353fbc992cfc90c33456419 100644 (file)
@@ -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')
index 4b40419d8a4b3d8c0acf482102b6e80ef2ab94c2..071cbcd9b4682483d7d99272882a1dc5348460d6 100644 (file)
@@ -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
index 442eb6563f90aefd03a104a422f500c2ea4cc7e6..fe186624dcbb69e9753a1038a9e3baec4c11f447 100644 (file)
@@ -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',