meson: use a feature option for gallium-vdpau
Which we can use with the require method, and use the feature itself as the require argument to dependency call. All of this results in less code Reviewed-by: Jesse Natalie <jenatali@microsoft.com> Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
This commit is contained in:
parent
8dcc1f8311
commit
eac76e433d
2 changed files with 19 additions and 47 deletions
62
meson.build
62
meson.build
|
|
@ -640,53 +640,27 @@ if with_gallium_d3d12 and not _with_gallium_d3d12_video.disabled()
|
||||||
pre_args += '-DHAVE_GALLIUM_D3D12_VIDEO'
|
pre_args += '-DHAVE_GALLIUM_D3D12_VIDEO'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
_vdpau = get_option('gallium-vdpau')
|
_vdpau_drivers = [
|
||||||
if _vdpau == 'true'
|
with_gallium_d3d12_video,
|
||||||
_vdpau = 'enabled'
|
with_gallium_nouveau,
|
||||||
warning('gallium-vdpau option "true" deprecated, please use "enabled" instead.')
|
with_gallium_r300,
|
||||||
elif _vdpau == 'false'
|
with_gallium_r600,
|
||||||
_vdpau = 'disabled'
|
with_gallium_radeonsi,
|
||||||
warning('gallium-vdpau option "false" deprecated, please use "disabled" instead.')
|
with_gallium_virgl,
|
||||||
endif
|
]
|
||||||
if not system_has_kms_drm
|
|
||||||
if _vdpau == 'enabled'
|
|
||||||
error('VDPAU state tracker can only be build on unix-like OSes.')
|
|
||||||
else
|
|
||||||
_vdpau = 'disabled'
|
|
||||||
endif
|
|
||||||
elif not with_platform_x11
|
|
||||||
if _vdpau == 'enabled'
|
|
||||||
error('VDPAU state tracker requires X11 support.')
|
|
||||||
else
|
|
||||||
_vdpau = 'disabled'
|
|
||||||
endif
|
|
||||||
elif not [
|
|
||||||
with_gallium_d3d12_video,
|
|
||||||
with_gallium_nouveau,
|
|
||||||
with_gallium_r300,
|
|
||||||
with_gallium_r600,
|
|
||||||
with_gallium_radeonsi,
|
|
||||||
with_gallium_virgl,
|
|
||||||
].contains(true)
|
|
||||||
if _vdpau == 'enabled'
|
|
||||||
error('VDPAU state tracker requires at least one of the following gallium drivers: r300, r600, radeonsi, nouveau, d3d12 (with option gallium-d3d12-video, virgl).')
|
|
||||||
else
|
|
||||||
_vdpau = 'disabled'
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
dep_vdpau = null_dep
|
|
||||||
with_gallium_vdpau = false
|
|
||||||
if _vdpau != 'disabled'
|
|
||||||
dep_vdpau = dependency('vdpau', version : '>= 1.1', required : _vdpau == 'enabled')
|
|
||||||
if dep_vdpau.found()
|
|
||||||
dep_vdpau = dep_vdpau.partial_dependency(compile_args : true)
|
|
||||||
with_gallium_vdpau = true
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
if with_gallium_vdpau
|
vdpau = get_option('gallium-vdpau') \
|
||||||
|
.require(system_has_kms_drm, error_message : 'VDPAU state tracker can only be build on unix-like OSes.') \
|
||||||
|
.require(with_platform_x11, error_message : 'VDPAU state tracker requires X11 support.') \
|
||||||
|
.require(_vdpau_drivers.contains(true), error_message : 'VDPAU state tracker requires at least one of the following gallium drivers: r300, r600, radeonsi, nouveau, d3d12 (with option gallium-d3d12-video, virgl).')
|
||||||
|
|
||||||
|
dep_vdpau = dependency('vdpau', version : '>= 1.1', required : vdpau)
|
||||||
|
if dep_vdpau.found()
|
||||||
|
dep_vdpau = dep_vdpau.partial_dependency(compile_args : true)
|
||||||
pre_args += '-DHAVE_ST_VDPAU'
|
pre_args += '-DHAVE_ST_VDPAU'
|
||||||
endif
|
endif
|
||||||
|
with_gallium_vdpau = dep_vdpau.found()
|
||||||
|
|
||||||
vdpau_drivers_path = get_option('vdpau-libs-path')
|
vdpau_drivers_path = get_option('vdpau-libs-path')
|
||||||
if vdpau_drivers_path == ''
|
if vdpau_drivers_path == ''
|
||||||
vdpau_drivers_path = join_paths(get_option('libdir'), 'vdpau')
|
vdpau_drivers_path = join_paths(get_option('libdir'), 'vdpau')
|
||||||
|
|
|
||||||
|
|
@ -85,9 +85,7 @@ option(
|
||||||
)
|
)
|
||||||
option(
|
option(
|
||||||
'gallium-vdpau',
|
'gallium-vdpau',
|
||||||
type : 'combo',
|
type : 'feature',
|
||||||
value : 'auto',
|
|
||||||
choices : ['auto', 'true', 'false', 'enabled', 'disabled'],
|
|
||||||
description : 'enable gallium vdpau frontend.',
|
description : 'enable gallium vdpau frontend.',
|
||||||
)
|
)
|
||||||
option(
|
option(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue