Skip to content

Commit

Permalink
meson: Update option names to omit disable_ and with- prefixes
Browse files Browse the repository at this point in the history
Also yield common options to the outer project (gst-build in our case)
so that they don't have to be set manually and use array types for some
options.
  • Loading branch information
nirbheek committed May 5, 2018
1 parent 5b736d2 commit 1e1a5d6
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 37 deletions.
21 changes: 9 additions & 12 deletions gst-libs/gst/gl/meson.build
Expand Up @@ -153,27 +153,26 @@ enabled_gl_platforms = []
enabled_gl_winsys = []

# parse provided options
libegl_module_name = get_option('with_egl_module_name')
libegl_module_name = get_option('egl_module_name')
if libegl_module_name != ''
gl_cpp_args += ['-DGST_GL_LIBEGL_MODULE_NAME="@0@"'.format(libegl_module_name)]
endif
libgles2_module_name = get_option('with_gles2_module_name')
libgles2_module_name = get_option('gles2_module_name')
if libgles2_module_name != ''
gl_cpp_args += ['-DGST_GL_LIBGLESV2_MODULE_NAME="@0@"'.format(libgles2_module_name)]
endif
libgl_module_name = get_option('with_opengl_module_name')
libgl_module_name = get_option('opengl_module_name')
if libgl_module_name != ''
gl_cpp_args += ['-DGST_GL_LIBGL_MODULE_NAME="@0@"'.format(libgl_module_name)]
endif

gl_apis_s = get_option ('with_gl_api')
if gl_apis_s == 'auto'
gl_apis = get_option('gl_api')
if gl_apis.contains('auto')
need_api_opengl = 'auto'
need_api_gles2 = 'auto'
else
need_api_opengl = 'no'
need_api_gles2 = 'no'
gl_apis = gl_apis_s.split(',')
foreach api : gl_apis
if api == 'opengl'
need_api_opengl = 'yes'
Expand All @@ -185,8 +184,8 @@ else
endforeach
endif

gl_platforms_s = get_option ('with_gl_platform')
if gl_platforms_s == 'auto'
gl_platforms = get_option('gl_platform')
if gl_platforms.contains('auto')
need_platform_egl = 'auto'
need_platform_glx = 'auto'
need_platform_cgl = 'auto'
Expand All @@ -198,7 +197,6 @@ else
need_platform_cgl = 'no'
need_platform_wgl = 'no'
need_platform_eagl = 'no'
gl_platforms = gl_platforms_s.split(',')
foreach platform : gl_platforms
if platform == 'egl'
need_platform_egl = 'yes'
Expand All @@ -216,8 +214,8 @@ else
endforeach
endif

gl_winsys_s = get_option ('with_gl_winsys')
if gl_winsys_s == 'auto'
gl_winsys = get_option('gl_winsys')
if gl_winsys.contains('auto')
need_win_x11 = 'auto'
need_win_wayland = 'auto'
need_win_win32 = 'auto'
Expand All @@ -235,7 +233,6 @@ else
need_win_dispmanx = 'no'
need_win_viv_fb = 'no'
need_win_gbm = 'no'
gl_winsys = gl_winsys_s.split(',')
foreach winsys : gl_winsys
if winsys == 'x11'
need_win_x11 = 'yes'
Expand Down
14 changes: 7 additions & 7 deletions meson.build
Expand Up @@ -171,7 +171,7 @@ foreach extra_arg : warning_c_flags
endforeach

# 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 Base Plug-ins source release'
Expand All @@ -182,7 +182,7 @@ if gst_package_name == ''
endif
endif
core_conf.set_quoted('GST_PACKAGE_NAME', gst_package_name)
core_conf.set_quoted('GST_PACKAGE_ORIGIN', get_option('with-package-origin'))
core_conf.set_quoted('GST_PACKAGE_ORIGIN', get_option('package-origin'))

# FIXME: These should be configure options
core_conf.set('DEFAULT_VIDEOSINK', '"autovideosink"')
Expand Down Expand Up @@ -251,8 +251,8 @@ gst_controller_dep = dependency('gstreamer-controller-1.0', version : gst_req,

have_orcc = false
orcc_args = []
if get_option('use_orc') != 'no'
need_orc = get_option('use_orc') == 'yes'
if get_option('orc') != 'no'
need_orc = get_option('orc') == 'yes'
# Used by various libraries/elements that use Orc code
orc_dep = dependency('orc-0.4', version : orc_req, required : need_orc)
orcc = find_program('orcc', required : need_orc)
Expand Down Expand Up @@ -280,7 +280,7 @@ have_sse41 = cc.has_argument(sse41_args)
if gst_dep.type_name() == 'internal'
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')
add_project_arguments('-Wno-unused', language: 'c')
else
Expand All @@ -303,7 +303,7 @@ endif

gir = find_program('g-ir-scanner', required : false)
gnome = import('gnome')
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);' + \
'g_setenv("GST_REGISTRY_1.0", "@0@", TRUE);'.format(meson.current_build_dir() + '/gir_empty_registry.reg') + \
Expand Down Expand Up @@ -333,7 +333,7 @@ endif

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()
Expand Down
42 changes: 26 additions & 16 deletions meson_options.txt
@@ -1,18 +1,28 @@
option('audioresample_format', type : 'combo', choices : ['int', 'float', 'auto'], value : 'auto')
option('disable_examples', type : 'boolean', value : false)
option('use_orc', type : 'combo', choices : ['yes', 'no', 'auto'], value : 'auto')
option('disable_introspection',
type : 'boolean', value : false,
description : 'Whether to disable the introspection generation')
option('disable_gtkdoc', type : 'boolean', value : false)
option('with-package-name', type : 'string',
option('audioresample_format', type : 'combo',
choices : ['int', 'float', 'auto'], value : 'auto')
option('gl_api', type : 'array', choices : ['opengl', 'gles2', 'auto'], value : ['auto'],
description : 'A comma separated list of opengl APIs to enable building against')
option('gl_platform', type : 'array',
choices : ['glx', 'egl', 'cgl', 'wgl', 'eagl', 'auto'], value : ['auto'],
description : 'A comma separated list of opengl platforms to enable building against')
option('gl_winsys', type : 'array',
choices : ['x11', 'wayland', 'win32', 'cocoa', 'dispmanx', 'auto'], value : ['auto'],
description : 'A comma separated list of opengl windows systems to enable building against. Supported values are x11, wayland, win32, cocoa, and dispmanx')
option('egl_module_name', type : 'string', value : '',
description : 'The file to pass to g_module_open to open the libEGL library (default: libEGL)')
option('opengl_module_name', type : 'string', value : '',
description : 'The file to pass to g_module_open to open the libGL library (default: libGL)')
option('gles2_module_name', type : 'string', value : '',
description : 'The file to pass to g_module_open to open the libGLESv2 library (default: libGLESv2)')

# Common options
option('orc', type : 'combo', choices : ['yes', 'no', 'auto'], value : 'auto', yield : true)
option('examples', type : 'boolean', value : true, yield : true)
option('gtkdoc', type : 'boolean', value : true, yield : true,
description : 'Build 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('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')
option('with_gl_api', type : 'string', value : 'auto', description : 'A comma separated list of opengl APIs to enable building against. Supported values are opengl and gles2.')
option('with_gl_platform', type : 'string', value : 'auto', description : 'A comma separated list of opengl platforms to enable building against. Supported values are glx, egl, cgl, wgl and eagl')
option('with_gl_winsys', type : 'string', value : 'auto', description : 'A comma separated list of opengl windows systems to enable building against. Supported values are x11, wayland, win32, cocoa, and dispmanx')
option('with_egl_module_name', type : 'string', value : '', description : 'The file to pass to g_module_open to open the libEGL.so library (default: libEGL.so)')
option('with_opengl_module_name', type : 'string', value : '', description : 'The file to pass to g_module_open to open the libGL.so library (default: libGL.so)')
option('with_gles2_module_name', type : 'string', value : '', description : 'The file to pass to g_module_open to open the libGLESv2.so library (default: libGLESv2.so)')

2 changes: 1 addition & 1 deletion tests/check/meson.build
@@ -1,4 +1,4 @@
have_registry = true # FIXME not get_option('disable_registry')
have_registry = true # FIXME get_option('registry')

# name, condition when to skip the test and extra dependencies
base_tests = [
Expand Down
2 changes: 1 addition & 1 deletion tests/meson.build
Expand Up @@ -2,7 +2,7 @@
if host_machine.system() != 'windows'
subdir('check')
endif
if not get_option('disable_examples')
if get_option('examples')
subdir('examples')
endif
#subdir('files')
Expand Down

0 comments on commit 1e1a5d6

Please sign in to comment.