meson: Convert common options to feature options

The rest will be converted later, these are necessary for gst-build to
set options correctly.

https://bugzilla.gnome.org/show_bug.cgi?id=795107
This commit is contained in:
Nirbheek Chauhan 2018-07-25 17:27:03 +05:30
parent 0dbfa44839
commit fa3648d5fe
4 changed files with 24 additions and 28 deletions

View file

@ -1,6 +1,6 @@
project('gst-devtools', 'c',
version : '1.15.0.1',
meson_version : '>= 0.46.0',
meson_version : '>= 0.47',
default_options : [ 'warning_level=1',
'c_std=gnu99',
'buildtype=debugoptimized' ])
@ -88,12 +88,10 @@ gir_init_section = [ '--add-init-section=extern void gst_init(gint*,gchar**);' +
'g_setenv("GST_PLUGIN_PATH_1_0", "", TRUE);' + \
'g_setenv("GST_PLUGIN_SYSTEM_PATH_1_0", "", TRUE);' + \
'gst_init(NULL,NULL);' ]
gir = find_program('g-ir-scanner', required : false)
build_gir = gir.found() and not meson.is_cross_build() and get_option('introspection')
gir = find_program('g-ir-scanner', required : get_option('introspection'))
build_gir = gir.found() and not meson.is_cross_build()
gnome = import('gnome')
gtkdoc = find_program('gtkdoc-scan', required : false)
if gst_dep.type_name() == 'internal'
gst_debug_disabled = not subproject('gstreamer').get_variable('gst_debug')
else

View file

@ -2,7 +2,7 @@ option('validate', type : 'boolean', value : true,
description : 'Build GstValidate')
option('debug_viewer', type : 'boolean', value : true,
description : 'Build GstDebugViewer')
option('introspection', type : 'boolean', value : true, yield : true,
option('gtk_doc', type : 'feature', value : 'auto', yield : true,
description : 'Build API documentation with gtk-doc')
option('introspection', type : 'feature', value : 'auto', yield : true,
description : 'Generate gobject-introspection bindings')
option('gtk_doc', type : 'boolean', value : true, yield : true,
description : 'Generate API documentation with gtk-doc')

View file

@ -1,6 +1,6 @@
types = configure_file(input : 'gst-validate.types',
output : 'gst-validate.types',
configuration : configuration_data())
copy: true)
doc_deps_names = ['glib-2.0',
'gstreamer-@0@'.format(apiversion),
@ -8,6 +8,7 @@ doc_deps_names = ['glib-2.0',
doc_deps = []
foreach doc_dep : doc_deps_names
# FIXME: use get_pkgconfig_variable() instead
runcmd = run_command('pkg-config', '--variable=prefix', doc_dep)
if runcmd.returncode() == 0
tmp = '--extra-dir=' + runcmd.stdout().strip() + '/share/gtk-doc/html/'
@ -16,7 +17,6 @@ foreach doc_dep : doc_deps_names
endif
endforeach
if gtkdoc.found()
gnome.gtkdoc('gst-validate',
main_sgml : 'gst-validate-docs.sgml',
src_dir : '@0@/../../gst/validate'.format(meson.current_source_dir()),
@ -30,4 +30,3 @@ if gtkdoc.found()
content_files : ['gst-validate.xml', 'gst-validate-transcoding.xml', 'gst-validate-media-check.xml', 'gst-validate-launcher.xml', 'envvariables.xml', 'scenarios.xml'],
fixxref_args: doc_deps + ['--html-dir=' + get_option('prefix') + '/share/gtk-doc/html/'],
install : true)
endif

View file

@ -27,10 +27,9 @@ subdir('launcher')
subdir('tools')
if build_machine.system() == 'windows'
message('Disabling gtk-doc while building on Windows')
elif not get_option('gtk_doc')
message('gtk-doc is disabled via options')
else
if find_program('gtkdoc-scan', required : false).found()
gtkdoc = find_program('gtkdoc-scan', required : get_option('gtk_doc'))
if gtkdoc.found()
subdir('docs')
else
message('Not building documentation as gtk-doc was not found')