From e48c4d5d69bed5b93a1cc63df21ff97dcecc658c Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Mon, 12 Feb 2018 12:29:06 +0000 Subject: build: Update the introspection rules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We should not be using cross-compilation to gate the generation of introspection data; it's perfectly possible to use a helper binary to run g-ir-scanner when cross-compiling — in fact, that's what projects like Yocto already do. We should also return a target for the introspection data, to allow using gdk-pixbuf as a sub-project. --- gdk-pixbuf/meson.build | 32 +++++++++++++++++--------------- meson.build | 2 +- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/gdk-pixbuf/meson.build b/gdk-pixbuf/meson.build index 5ab6f94f7..58d54f7b2 100644 --- a/gdk-pixbuf/meson.build +++ b/gdk-pixbuf/meson.build @@ -242,25 +242,27 @@ loaders_cache = custom_target('loaders.cache', build_by_default: true) loaders_dep = declare_dependency(sources: [ loaders_cache ]) -build_gir = get_option('gir') and not meson.is_cross_build() +build_gir = get_option('gir') 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) + gdkpixbuf_gir = 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', ], + header: 'gdk-pixbuf/gdk-pixbuf.h', + install: true, + extra_args: gir_args, + ) endif diff --git a/meson.build b/meson.build index 2f7b5d3b8..185ea6a26 100644 --- a/meson.build +++ b/meson.build @@ -6,7 +6,7 @@ project('gdk-pixbuf', 'c', 'warning_level=1', 'c_std=c99', ], - meson_version: '>= 0.40.1') + meson_version: '>= 0.43.0') add_project_arguments([ '-D_POSIX_C_SOURCE=200809L', '-D_DEFAULT_SOURCE', '-D_XOPEN_SOURCE' ], language: 'c') -- cgit v1.2.1