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:27:24 +05:30
parent 36e49fd6f8
commit 65536f25dd
3 changed files with 15 additions and 13 deletions

View File

@ -187,7 +187,7 @@ foreach extra_arg : warning_c_flags
endforeach endforeach
# GStreamer package name and origin url # 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_package_name == ''
if gst_version_nano == 0 if gst_version_nano == 0
gst_package_name = 'GStreamer Good Plug-ins source release' gst_package_name = 'GStreamer Good Plug-ins source release'
@ -198,7 +198,7 @@ if gst_package_name == ''
endif endif
endif endif
cdata.set_quoted('GST_PACKAGE_NAME', gst_package_name) 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'))
# Mandatory GST deps # Mandatory GST deps
gst_dep = dependency('gstreamer-1.0', version : gst_req, gst_dep = dependency('gstreamer-1.0', version : gst_req,
@ -314,8 +314,8 @@ libsinc = include_directories('gst-libs')
have_orcc = false have_orcc = false
orcc_args = [] orcc_args = []
if get_option('use_orc') != 'no' if get_option('orc') != 'no'
need_orc = get_option('use_orc') == 'yes' need_orc = get_option('orc') == 'yes'
# Used by various libraries/elements that use Orc code # Used by various libraries/elements that use Orc code
orc_dep = dependency('orc-0.4', version : '>= 0.4.17', required : need_orc) orc_dep = dependency('orc-0.4', version : '>= 0.4.17', required : need_orc)
orcc = find_program('orcc', required : need_orc) orcc = find_program('orcc', required : need_orc)
@ -334,7 +334,7 @@ endif
if gst_dep.type_name() == 'internal' if gst_dep.type_name() == 'internal'
gst_proj = subproject('gstreamer') gst_proj = subproject('gstreamer')
if gst_proj.get_variable('disable_gst_debug') if not gst_proj.get_variable('gst_debug')
message('GStreamer debug system is disabled') message('GStreamer debug system is disabled')
add_project_arguments('-Wno-unused', language: 'c') add_project_arguments('-Wno-unused', language: 'c')
else else

View File

@ -1,10 +1,12 @@
# Enable V4L2 plugin to probe devices at plugin load # Enable V4L2 plugin to probe devices at plugin load
option('v4l2-probe', type : 'boolean', value : true) option('v4l2-probe', type : 'boolean', value : true,
# Use libv4l2 for some obscure format conversions description : 'Probe v4l2 devices when the v4l2 plugin is loaded')
option('with-libv4l2', type : 'boolean', value : true) option('libv4l2', type : 'boolean', value : true,
# Whether to use orc or not (auto will autodetect, yes will error out if not found) description : 'Use libv4l2 for some obscure format conversions')
option('use_orc', type : 'combo', choices : ['yes', 'no', 'auto'], value : 'auto')
option('with-package-name', type : 'string', # Common options
option('orc', type : 'combo', choices : ['yes', 'no', 'auto'], value : 'auto')
option('package-name', type : 'string', yield : true,
description : 'package name to use in plugins') description : 'package name to use in plugins')
option('with-package-origin', type : 'string', value : 'Unknown package origin', option('package-origin', type : 'string', value : 'Unknown package origin', yield : true,
description : 'package origin URL to use in plugins') description : 'package origin URL to use in plugins')

View File

@ -35,7 +35,7 @@ if cc.has_header('linux/videodev2.h') or cc.has_header('sys/videodev2.h') or cc.
# libv4l2 is only needed for converting some obscure formats # libv4l2 is only needed for converting some obscure formats
# FIXME: Add a full list of the formats here # FIXME: Add a full list of the formats here
if get_option('with-libv4l2') if get_option('libv4l2')
libv4l2_dep = dependency('libv4l2', required : false) libv4l2_dep = dependency('libv4l2', required : false)
cdata.set('HAVE_LIBV4L2', libv4l2_dep.found()) cdata.set('HAVE_LIBV4L2', libv4l2_dep.found())
libv4l2_deps = [libv4l2_dep] libv4l2_deps = [libv4l2_dep]