From ed61bff07278b935e6dca33866df9a4a1c284e40 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Fri, 26 Aug 2016 20:06:59 -0300 Subject: [PATCH] meson: Allow others to build GIR files when using GStreamer as subproject And add a way to disable the introspection and bump version to 1.9.2 --- gst/meson.build | 13 +++++++++---- meson.build | 4 ++-- meson_options.txt | 3 +++ 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/gst/meson.build b/gst/meson.build index 5ba17f1..f522c0f 100644 --- a/gst/meson.build +++ b/gst/meson.build @@ -205,6 +205,9 @@ if libtype != 'shared' libgst = libgst_static endif +# Make sure that subproject building gir files work +gst_incdirs = [configinc] +gst_gen_sources = [gstenum_h] if libtype != 'static' libgst_shared = shared_library('gstreamer-1.0', gst_sources, gstenum_h, gstenum_c, grammar, parser, gst_registry, @@ -230,7 +233,9 @@ if libtype != 'static' '-I' + meson.current_build_dir() + '/..', '--cflags-end'] endif - gnome.generate_gir(libgst_shared, + + gst_incdirs += [include_directories(meson.current_build_dir() + '/..')] + gst_gen_sources += [gnome.generate_gir(libgst_shared, sources : gst_sources + gst_headers, namespace : 'Gst', nsversion : apiversion, @@ -240,13 +245,13 @@ if libtype != 'static' includes : ['GLib-2.0', 'GObject-2.0', 'GModule-2.0' ], install : true, extra_args : gst_gir_extra_args, - ) + )] endif endif gst_dep = declare_dependency(link_with : libgst, - include_directories : [configinc], + include_directories : gst_incdirs, dependencies : [glib_dep, gobject_dep, gmodule_dep], # Everything that uses libgst needs this built to compile - sources : [gstenum_h], + sources : gst_gen_sources, ) diff --git a/meson.build b/meson.build index 5dc2dc2..d594dac 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('gstreamer', 'c', 'cpp', - version : '1.9.1.1', + version : '1.9.2.1', meson_version : '>= 0.33.0', default_options : [ 'warning_level=1', 'c_std=gnu99', @@ -260,7 +260,7 @@ gir = find_program('g-ir-scanner', required : false) gnome = import('gnome') # Fixme, not very elegant. -build_gir = gir.found() and not meson.is_cross_build() +build_gir = gir.found() and not meson.is_cross_build() and not get_option('disable_introspection') gir_init_section = [ '--add-init-section=extern void gst_init(gint*,gchar**); gst_init(NULL,NULL);' ] vs_module_defs_dir = meson.source_root() + '/win32/common/' diff --git a/meson_options.txt b/meson_options.txt index 7ccd5fd..52af8d5 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -3,3 +3,6 @@ option('poisoning', type : 'boolean', value : false) option('disable_examples', type : 'boolean', value : false) option('disable_registry', type : 'boolean', value : false) option('library_format', type : 'combo', choices : ['shared', 'static', 'both'], value : 'shared') +option('disable_introspection', + type : 'boolean', value : false, + description : 'Whether to disable the introspection generation') -- 2.7.4