meson: Allow others to build GIR files when using GStreamer as subproject
authorThibault Saunier <tsaunier@gnome.org>
Fri, 26 Aug 2016 23:06:59 +0000 (20:06 -0300)
committerThibault Saunier <thibault.saunier@osg.samsung.com>
Mon, 5 Sep 2016 15:39:12 +0000 (12:39 -0300)
And add a way to disable the introspection and bump version to 1.9.2

gst/meson.build
meson.build
meson_options.txt

index 5ba17f1..f522c0f 100644 (file)
@@ -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,
 )
index 5dc2dc2..d594dac 100644 (file)
@@ -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/'
index 7ccd5fd..52af8d5 100644 (file)
@@ -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')