meson: Handle building the gir file when used as subproject

Add support for building GIR when used as subproject
Add an option to disable GIR generation
And bump version to 1.9.2
This commit is contained in:
Thibault Saunier 2016-08-26 19:55:33 -03:00 committed by Thibault Saunier
parent 754483f528
commit c7ade2bf84
3 changed files with 19 additions and 5 deletions

View file

@ -162,8 +162,18 @@ libges = shared_library('ges-1.0', ges_sources, parser,
dependencies : libges_deps
)
ges_gen_sources = []
if build_gir
gnome.generate_gir(libges,
ges_gir_extra_args = gir_init_section + [ '--c-include=ges/ges.h' ]
if meson.is_subproject()
# FIXME: There must be a better way to do this
# Need to pass the include path to find gst/gst.h and gst/gstenumtypes.h (built)
ges_gir_extra_args += ['--cflags-begin',
'-I' + meson.current_source_dir() + '/..',
'-I' + meson.current_build_dir() + '/..',
'--cflags-end']
endif
ges_gen_sources += [gnome.generate_gir(libges,
sources : ges_sources + ges_headers,
namespace : 'GES',
nsversion : apiversion,
@ -173,10 +183,11 @@ if build_gir
includes : ['Gst-1.0', 'GstPbutils-1.0', 'GstVideo-1.0', 'Gio-2.0'],
install : true,
dependencies : libges_deps,
extra_args : gir_init_section
)
extra_args : ges_gir_extra_args
)]
endif
ges_dep = declare_dependency(link_with : libges,
include_directories : [configinc],
sources : ges_gen_sources
)

View file

@ -1,5 +1,5 @@
project('gst-editing-services', 'c',
version : '1.9.1.1',
version : '1.9.2.1',
meson_version : '>= 0.33.0',
default_options : [ 'warning_level=1',
'c_std=gnu99',
@ -85,7 +85,7 @@ gnome = import('gnome')
gtkdoc = find_program('gtkdoc-scan', required : false)
# 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);' ]
ges_c_args = ['-DHAVE_CONFIG_H']

3
meson_options.txt Normal file
View file

@ -0,0 +1,3 @@
option('disable_introspection',
type : 'boolean', value : false,
description : 'Whether to disable the introspection generation')