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
This commit is contained in:
Thibault Saunier 2016-08-26 20:06:59 -03:00 committed by Thibault Saunier
parent b3a8885e35
commit ed61bff072
3 changed files with 14 additions and 6 deletions

View 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,
)

View 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/'

View 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')