[gdk-pixbuf] meson: Generate introspection data



commit 16fe45c7bb345f1e7c1b1dd4b287f3197d015974
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Wed Aug 2 11:17:14 2017 +0100

    meson: Generate introspection data
    
    Just like the Autotools build does.
    
    We also provide a simple escape hatch for platforms where building
    introspection data is too complicated at the moment.

 gdk-pixbuf/meson.build |   36 ++++++++++++++++++++++++++++++------
 meson_options.txt      |    6 +++++-
 2 files changed, 35 insertions(+), 7 deletions(-)
---
diff --git a/gdk-pixbuf/meson.build b/gdk-pixbuf/meson.build
index 81ea843..26dcb5b 100644
--- a/gdk-pixbuf/meson.build
+++ b/gdk-pixbuf/meson.build
@@ -41,11 +41,12 @@ gdkpixbuf_features_conf.set('GDK_PIXBUF_MAJOR', gdk_pixbuf_version_major)
 gdkpixbuf_features_conf.set('GDK_PIXBUF_MINOR', gdk_pixbuf_version_minor)
 gdkpixbuf_features_conf.set('GDK_PIXBUF_MICRO', gdk_pixbuf_version_micro)
 gdkpixbuf_features_conf.set('GDK_PIXBUF_VERSION', meson.project_version())
-configure_file(input: 'gdk-pixbuf-features.h.in',
-               output: 'gdk-pixbuf-features.h',
-               configuration: gdkpixbuf_features_conf,
-               install: true,
-               install_dir: join_paths(gdk_pixbuf_includedir, gdk_pixbuf_api_path))
+
+gdk_pixbuf_features_h = configure_file(input: 'gdk-pixbuf-features.h.in',
+                                       output: 'gdk-pixbuf-features.h',
+                                       configuration: gdkpixbuf_features_conf,
+                                       install: true,
+                                       install_dir: join_paths(gdk_pixbuf_includedir, gdk_pixbuf_api_path))
 
 gdkpixbuf_headers = [
   'gdk-pixbuf.h',
@@ -59,7 +60,7 @@ gdkpixbuf_headers = [
   'gdk-pixbuf-transform.h',
 ]
 
-install_headers(gdkpixbuf_headers, subdir: gdk_pixbuf_api_path)
+install_headers(gdkpixbuf_headers + [ 'gdk-pixdata.h' ], subdir: gdk_pixbuf_api_path)
 
 gdkpixbuf_sources = [
   'gdk-pixbuf.c',
@@ -177,3 +178,26 @@ loaders_cache = custom_target('loaders.cache',
                               ],
                               build_by_default: true)
 loaders_dep = declare_dependency(source: loaders_cache)
+
+build_gir = get_option('with_gir') and not meson.is_cross_build()
+if build_gir
+  gir_args = [
+    '--quiet',
+    '--c-include=gdk-pixbuf/gdk-pixbuf.h',
+    '-DGDK_PIXBUF_COMPILATION',
+  ]
+
+  gnome.generate_gir(gdkpixbuf,
+                     sources: gdkpixbuf_sources + gdkpixbuf_headers + gdkpixbuf_enums + [
+                       gdk_pixbuf_features_h,
+                       'gdk-pixdata.h',
+                     ],
+                     namespace: 'GdkPixbuf',
+                     nsversion: gdk_pixbuf_api_version,
+                     identifier_prefix: 'Gdk',
+                     symbol_prefix: 'gdk',
+                     export_packages: 'gdk-pixbuf-2.0',
+                     includes: [ 'GModule-2.0', 'Gio-2.0', ],
+                     install: true,
+                     extra_args: gir_args)
+endif
diff --git a/meson_options.txt b/meson_options.txt
index 55f9cca..b910c96 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -15,10 +15,14 @@ option('enable_jasper',
        type: 'boolean',
        value: false)
 option('builtin_loaders',
-       description: 'Comma-separated list of loaders to build into gdk-pixbuf',
+       description: 'Comma-separated list of loaders to build into gdk-pixbuf, or "none"',
        type: 'string',
        value: 'none')
 option('with_docs',
        description: 'Whether to generate the API reference (requires GTK-Doc)',
        type: 'boolean',
        value: false)
+option('with_gir',
+       description: 'Whether to generate the API introspection data (requires GObject-Introspection)',
+       type: 'boolean',
+       value: true)


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