[gdk-pixbuf] meson: Change introspection option to feature type



commit 50387389beda3df666b3ef80811353b35f6d59fd
Author: Xavier Claessens <xavier claessens collabora com>
Date:   Wed Oct 14 16:55:00 2020 -0400

    meson: Change introspection option to feature type
    
    This is more consistent with other modules like GTK.

 gdk-pixbuf/meson.build | 4 +++-
 meson.build            | 2 +-
 meson_options.txt      | 7 ++++---
 3 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/gdk-pixbuf/meson.build b/gdk-pixbuf/meson.build
index fdf98da52b..d9a254f140 100644
--- a/gdk-pixbuf/meson.build
+++ b/gdk-pixbuf/meson.build
@@ -181,7 +181,9 @@ gdkpixbuf = library('gdk_pixbuf-2.0',
                     ],
                     install: true)
 
-build_gir = get_option('gir')
+gir = find_program('g-ir-scanner', required : get_option('introspection'))
+build_gir = gir.found() and (not meson.is_cross_build() or get_option('introspection').enabled())
+
 if build_gir
   gir_args = [
     '--quiet',
diff --git a/meson.build b/meson.build
index c1423ddba7..a499ecaea7 100644
--- a/meson.build
+++ b/meson.build
@@ -417,7 +417,7 @@ summary = [
   '',
   '    documentation: @0@'.format(build_docs),
   '        man pages: @0@'.format(get_option('man')),
-  '    introspection: @0@'.format(get_option('gir')),
+  '    introspection: @0@'.format(build_gir),
   '  installed tests: @0@'.format(get_option('installed_tests')),
   '      relocatable: @0@'.format(get_option('relocatable')),
   '',
diff --git a/meson_options.txt b/meson_options.txt
index c1136cd968..930f3bdf8f 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -22,10 +22,11 @@ option('docs',
        description: 'Whether to generate the whole documentation (see: gtk_doc and man options) 
[Deprecated]',
        type: 'boolean',
        value: false)
-option('gir',
+option('introspection',
        description: 'Whether to generate the API introspection data (requires GObject-Introspection)',
-       type: 'boolean',
-       value: true)
+       type: 'feature',
+       value: 'auto',
+       yield: true)
 option('man',
        description: 'Whether to generate man pages (requires xlstproc)',
        type: 'boolean',


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