meson: Update option names to omit disable_ and with- prefixes

Also yield common options to the outer project (gst-build in our case)
so that they don't have to be set manually.
This commit is contained in:
Nirbheek Chauhan 2018-05-05 19:08:09 +05:30
parent a5ecb465a9
commit 4fb02fc85b
8 changed files with 88 additions and 88 deletions

View file

@ -150,27 +150,27 @@ gst_headers = [
]
install_headers(gst_headers, subdir : 'gstreamer-1.0/gst')
disable_registry = get_option('disable_registry')
if not disable_registry
gst_registry = ['gstregistrybinary.c']
gst_registry = get_option('registry')
if gst_registry
gst_registry_sources = ['gstregistrybinary.c']
else
gst_registry = []
gst_registry_sources = []
endif
# Make copy so configure_file consumes the copy and we can
# still add to the original cdata later.
gst_cdata = cdata
if disable_gst_debug
gst_cdata.set('GST_DISABLE_GST_DEBUG_DEFINE', '#define GST_DISABLE_GST_DEBUG 1')
else
if gst_debug
gst_cdata.set('GST_DISABLE_GST_DEBUG_DEFINE', '#undef GST_DISABLE_GST_DEBUG')
else
gst_cdata.set('GST_DISABLE_GST_DEBUG_DEFINE', '#define GST_DISABLE_GST_DEBUG 1')
endif
if disable_registry
gst_cdata.set('GST_DISABLE_REGISTRY_DEFINE', '#define GST_DISABLE_REGISTRY 1')
else
if gst_registry
gst_cdata.set('GST_DISABLE_REGISTRY_DEFINE', '#undef GST_DISABLE_REGISTRY')
else
gst_cdata.set('GST_DISABLE_REGISTRY_DEFINE', '#define GST_DISABLE_REGISTRY 1')
endif
# FIXME: add --disable-parse option? (but autotools doesn't seem to set this
@ -218,8 +218,8 @@ libgst_c_args = gst_c_args + [
'-DGST_DISABLE_DEPRECATED',
]
disable_tracer_hooks = get_option('disable_tracer_hooks')
if disable_tracer_hooks
tracer_hooks = get_option('tracer_hooks')
if not tracer_hooks
libgst_c_args += ['-DGST_DISABLE_GST_TRACER_HOOKS']
endif
@ -227,7 +227,7 @@ endif
gst_incdirs = [configinc]
gst_gen_sources = [gstenum_h]
libgst = library('gstreamer-1.0', gst_sources,
gstenum_h, gstenum_c, grammar, parser, gst_registry,
gstenum_h, gstenum_c, grammar, parser, gst_registry_sources,
version : libversion,
soversion : soversion,
c_args : libgst_c_args,

View file

@ -83,19 +83,19 @@ if have_ptp
setcap = find_program('setcap', '/usr/sbin/setcap', '/sbin/setcap', required : false)
# user/group to change to in gst-ptp-helper
ptp_helper_setuid_user = get_option('with-ptp-helper-setuid-user')
ptp_helper_setuid_user = get_option('ptp-helper-setuid-user')
if ptp_helper_setuid_user != ''
cdata.set_quoted('HAVE_PTP_HELPER_SETUID_USER', ptp_helper_setuid_user,
description : 'PTP helper setuid user')
endif
ptp_helper_setuid_group = get_option('with-ptp-helper-setuid-group')
ptp_helper_setuid_group = get_option('ptp-helper-setuid-group')
if ptp_helper_setuid_group != ''
cdata.set_quoted('HAVE_PTP_HELPER_SETUID_GROUP', ptp_helper_setuid_group,
description : 'PTP helper setuid group')
endif
# how to install gst-ptp-helper
with_ptp_helper_permissions = get_option('with-ptp-helper-permissions')
with_ptp_helper_permissions = get_option('ptp-helper-permissions')
if with_ptp_helper_permissions == 'auto'
if gst_ptp_have_cap and setcap.found()
with_ptp_helper_permissions = 'capabilities'

View file

@ -94,7 +94,7 @@ else
endif
# GStreamer package name and origin url
gst_package_name = get_option('with-package-name')
gst_package_name = get_option('package-name')
if gst_package_name == ''
if gst_version_nano == 0
gst_package_name = 'GStreamer source release'
@ -105,7 +105,7 @@ if gst_package_name == ''
endif
endif
cdata.set_quoted('GST_PACKAGE_NAME', gst_package_name)
cdata.set_quoted('GST_PACKAGE_ORIGIN', get_option('with-package-origin'))
cdata.set_quoted('GST_PACKAGE_ORIGIN', get_option('package-origin'))
# These are only needed/used by the ABI tests
host_defines = [
@ -301,7 +301,7 @@ if host_machine.system() == 'windows'
endif
backtrace_deps = []
if not get_option('disable_libunwind')
if get_option('libunwind')
unwind_dep = dependency('libunwind', required : false)
dw_dep = dependency('libdw', required: false)
backtrace_deps = [unwind_dep, dw_dep]
@ -333,8 +333,8 @@ if cc.has_header('execinfo.h')
endif
endif
disable_gst_debug = get_option('disable_gst_debug')
if disable_gst_debug
gst_debug = get_option('gst_debug')
if not gst_debug
add_project_arguments(['-Wno-unused'], language: 'c')
endif
@ -408,7 +408,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() and not get_option('disable_introspection')
build_gir = gir.found() and not meson.is_cross_build() and get_option('introspection')
gir_init_section = [ '--add-init-section=extern void gst_init(gint*,gchar**);' + \
'g_setenv("GST_REGISTRY_DISABLE", "yes", TRUE);' + \
@ -481,7 +481,7 @@ configure_file(output : 'config.h', configuration : cdata)
if build_machine.system() == 'windows'
message('Disabling gtk-doc while building on Windows')
elif get_option('disable_gtkdoc')
elif not get_option('gtkdoc')
message('gtk-doc is disabled via options')
else
if find_program('gtkdoc-scan', required : false).found()

View file

@ -1,23 +1,24 @@
option('build_tools', type : 'boolean', value : true)
option('poisoning', type : 'boolean', value : false)
option('disable_gtkdoc', type : 'boolean', value : false)
option('disable_examples', type : 'boolean', value : false)
option('disable_gst_debug', type : 'boolean', value : false)
option('disable_registry', type : 'boolean', value : false)
option('disable_tracer_hooks', type : 'boolean', value : false)
option('disable_introspection',
type : 'boolean', value : false,
description : 'Whether to disable the introspection generation')
option('disable_libunwind',
type : 'boolean', value : false,
description : 'Whether to disable the usage of libunwind (to generate backtraces)')
option('with-package-name', type : 'string',
description : 'package name to use in plugins')
option('with-package-origin', type : 'string', value : 'Unknown package origin',
description : 'package origin URL to use in plugins')
option('with-ptp-helper-setuid-user', type : 'string',
option('gst_debug', type : 'boolean', value : true)
option('registry', type : 'boolean', value : true)
option('tracer_hooks', type : 'boolean', value : true)
option('libunwind', type : 'boolean', value : true,
description : 'Use libunwind to generate backtraces')
option('ptp-helper-setuid-user', type : 'string',
description : 'User to switch to when installing gst-ptp-helper setuid root')
option('with-ptp-helper-setuid-group', type : 'string',
option('ptp-helper-setuid-group', type : 'string',
description : 'Group to switch to when installing gst-ptp-helper setuid root')
option('with-ptp-helper-permissions', type : 'combo',
option('ptp-helper-permissions', type : 'combo',
choices : ['none', 'setuid-root', 'capabilities', 'auto'], value : 'auto')
# Common options
option('examples', type : 'boolean', value : true, yield : true)
option('gtkdoc', type : 'boolean', value : true, yield : true,
description : 'Generate API documentation with gtk-doc')
option('introspection', type : 'boolean', value : true, yield : true,
description : 'Generate gobject-introspection bindings')
option('package-name', type : 'string', yield : true,
description : 'package name to use in plugins')
option('package-origin', type : 'string', value : 'Unknown package origin', yield : true,
description : 'package origin URL to use in plugins')

View file

@ -1,4 +1,4 @@
subdir('elements')
if not disable_tracer_hooks
if tracer_hooks
subdir('tracers')
endif

View file

@ -5,7 +5,7 @@ gst_tracers_sources = [
'gsttracers.c',
]
if not disable_gst_debug
if gst_debug
gst_tracers_sources += ['gstlog.c']
endif

View file

@ -1,16 +1,15 @@
have_registry = not get_option('disable_registry')
have_debug = true # FIXME
have_parse = true # FIXME
# tests and condition when to skip the test
core_tests = [
[ 'gst/gst.c', not have_registry ],
[ 'gst/gstabi.c', not have_registry ],
[ 'gst/gst.c', not gst_registry ],
[ 'gst/gstabi.c', not gst_registry ],
[ 'gst/gstatomicqueue.c' ],
[ 'gst/gstbuffer.c' ],
[ 'gst/gstbufferlist.c' ],
[ 'gst/gstbufferpool.c' ],
[ 'gst/gstchildproxy.c', not have_registry ],
[ 'gst/gstchildproxy.c', not gst_registry ],
[ 'gst/gstclock.c' ],
[ 'gst/gstcontext.c' ],
[ 'gst/gstcontroller.c' ],
@ -19,9 +18,9 @@ core_tests = [
[ 'gst/gstdatetime.c' ],
[ 'gst/gstdeinit.c' ],
[ 'gst/gstdevice.c' ],
[ 'gst/gstelement.c', not have_registry ],
[ 'gst/gstelementfactory.c', not have_registry ],
[ 'gst/gstghostpad.c', not have_registry ],
[ 'gst/gstelement.c', not gst_registry ],
[ 'gst/gstelementfactory.c', not gst_registry ],
[ 'gst/gstghostpad.c', not gst_registry ],
[ 'gst/gstinfo.c' ],
[ 'gst/gstiterator.c' ],
[ 'gst/gstmessage.c' ],
@ -29,16 +28,16 @@ core_tests = [
[ 'gst/gstmeta.c' ],
[ 'gst/gstminiobject.c' ],
[ 'gst/gstobject.c' ],
[ 'gst/gstpad.c', not have_registry ],
[ 'gst/gstpad.c', not gst_registry ],
[ 'gst/gstparamspecs.c' ],
[ 'gst/gstprintf.c', disable_gst_debug, printf_lib],
[ 'gst/gstpipeline.c', not have_registry ],
[ 'gst/gstprintf.c', not gst_debug, printf_lib],
[ 'gst/gstpipeline.c', not gst_registry ],
[ 'gst/gstpoll.c' ],
[ 'gst/gstplugin.c', not have_registry ],
[ 'gst/gstplugin.c', not gst_registry ],
[ 'gst/gstpreset.c' ],
[ 'gst/gstprotection.c' ],
[ 'gst/gstquery.c', not have_registry ],
[ 'gst/gstregistry.c', not have_registry ],
[ 'gst/gstquery.c', not gst_registry ],
[ 'gst/gstregistry.c', not gst_registry ],
[ 'gst/gstpromise.c'],
[ 'gst/gstsegment.c' ],
[ 'gst/gststream.c' ],
@ -49,23 +48,23 @@ core_tests = [
[ 'gst/gsttask.c' ],
[ 'gst/gsttoc.c' ],
[ 'gst/gsttocsetter.c' ],
[ 'gst/gsttracerrecord.c', disable_tracer_hooks or disable_gst_debug],
[ 'gst/gsttracerrecord.c', not tracer_hooks or not gst_debug],
[ 'gst/gsturi.c' ],
[ 'gst/gstutils.c', not have_registry ],
[ 'gst/gstutils.c', not gst_registry ],
[ 'gst/gstvalue.c' ],
[ 'generic/states.c', not have_registry ],
[ 'generic/states.c', not gst_registry ],
[ 'libs/adapter.c' ],
[ 'libs/aggregator.c' ],
[ 'libs/baseparse.c' ],
[ 'libs/basesrc.c', not have_registry ],
[ 'libs/basesink.c', not have_registry ],
[ 'libs/basesrc.c', not gst_registry ],
[ 'libs/basesink.c', not gst_registry ],
[ 'libs/bitreader.c' ],
[ 'libs/bytereader.c' ],
[ 'libs/bytewriter.c' ],
[ 'libs/bitreader-noinline.c' ],
[ 'libs/bytereader-noinline.c' ],
[ 'libs/bytewriter-noinline.c' ],
[ 'libs/collectpads.c', not have_registry ],
[ 'libs/collectpads.c', not gst_registry ],
[ 'libs/controller.c' ],
[ 'libs/flowcombiner.c' ],
[ 'libs/gstharness.c' ],
@ -78,42 +77,42 @@ core_tests = [
[ 'libs/transform2.c' ],
[ 'libs/typefindhelper.c' ],
[ 'libs/queuearray.c' ],
[ 'elements/capsfilter.c', not have_registry ],
[ 'elements/concat.c', not have_registry ],
[ 'elements/dataurisrc.c', not have_registry ],
[ 'elements/fakesrc.c', not have_registry ],
[ 'elements/fdsrc.c', not have_registry ],
[ 'elements/filesink.c', not have_registry ],
[ 'elements/filesrc.c', not have_registry ],
[ 'elements/funnel.c', not have_registry ],
[ 'elements/identity.c', not have_registry ],
[ 'elements/multiqueue.c', not have_registry ],
[ 'elements/selector.c', not have_registry ],
[ 'elements/streamiddemux.c', not have_registry ],
[ 'elements/tee.c', not have_registry ],
[ 'elements/queue.c', not have_registry ],
[ 'elements/queue2.c', not have_registry ],
[ 'elements/valve.c', not have_registry ],
[ 'pipelines/seek.c', not have_registry ],
[ 'pipelines/queue-error.c', not have_registry ],
[ 'elements/capsfilter.c', not gst_registry ],
[ 'elements/concat.c', not gst_registry ],
[ 'elements/dataurisrc.c', not gst_registry ],
[ 'elements/fakesrc.c', not gst_registry ],
[ 'elements/fdsrc.c', not gst_registry ],
[ 'elements/filesink.c', not gst_registry ],
[ 'elements/filesrc.c', not gst_registry ],
[ 'elements/funnel.c', not gst_registry ],
[ 'elements/identity.c', not gst_registry ],
[ 'elements/multiqueue.c', not gst_registry ],
[ 'elements/selector.c', not gst_registry ],
[ 'elements/streamiddemux.c', not gst_registry ],
[ 'elements/tee.c', not gst_registry ],
[ 'elements/queue.c', not gst_registry ],
[ 'elements/queue2.c', not gst_registry ],
[ 'elements/valve.c', not gst_registry ],
[ 'pipelines/seek.c', not gst_registry ],
[ 'pipelines/queue-error.c', not gst_registry ],
[ 'pipelines/parse-disabled.c', have_parse ],
[ 'pipelines/simple-launch-lines.c', not have_parse ],
[ 'pipelines/parse-launch.c', not have_parse ],
[ 'pipelines/cleanup.c', not have_parse ],
[ 'tools/gstinspect.c' ],
# These take quite long, put them at the end
[ 'elements/fakesink.c', not have_registry ],
[ 'gst/gstbin.c', not have_registry ],
[ 'gst/gstbus.c', not have_registry ],
[ 'gst/gstevent.c', not have_registry ],
[ 'pipelines/stress.c', not have_registry ],
[ 'generic/sinks.c', not have_registry ],
[ 'elements/fakesink.c', not gst_registry ],
[ 'gst/gstbin.c', not gst_registry ],
[ 'gst/gstbus.c', not gst_registry ],
[ 'gst/gstevent.c', not gst_registry ],
[ 'pipelines/stress.c', not gst_registry ],
[ 'generic/sinks.c', not gst_registry ],
]
# Make sure our headers are C++ clean
if add_languages('cpp', required : false)
core_tests += [
[ 'gst/gstcpp.cc', not have_registry ],
[ 'gst/gstcpp.cc', not gst_registry ],
[ 'libs/gstlibscpp.cc', false ],
]
endif

View file

@ -1,6 +1,6 @@
subdir('benchmarks')
subdir('check')
if not get_option('disable_examples')
if get_option('examples')
subdir('examples')
endif
subdir('misc')