summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Engestrom <[email protected]>2017-12-07 16:02:29 +0000
committerEric Engestrom <[email protected]>2018-01-31 11:17:03 +0000
commit724916c8a84b5bba8f880f17da936585d52c97b6 (patch)
treef87c57d65ebcf2f967e333abf987c2f71758a3c3
parent992af0a4b8224bdb4809e01c2f00d2f32546aee5 (diff)
meson: dedup gallium-xvmc logic
Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
-rw-r--r--meson.build38
1 files changed, 18 insertions, 20 deletions
diff --git a/meson.build b/meson.build
index 5c22e80ca5c..67702bded21 100644
--- a/meson.build
+++ b/meson.build
@@ -409,34 +409,32 @@ if vdpau_drivers_path == ''
vdpau_drivers_path = join_paths(get_option('libdir'), 'vdpau')
endif
-dep_xvmc = []
_xvmc = get_option('gallium-xvmc')
-if _xvmc == 'auto'
- if not system_has_kms_drm
- with_gallium_xvmc = false
- elif not with_platform_x11
- with_gallium_xvmc = false
- elif not (with_gallium_r600 or with_gallium_nouveau)
- with_gallium_xvmc = false
+if not system_has_kms_drm
+ if _xvmc == 'true'
+ error('XVMC state tracker can only be build on unix-like OSes.')
else
- dep_xvmc = dependency('xvmc', version : '>= 1.0.6', required : false)
- with_gallium_xvmc = dep_xvmc.found()
+ _xvmc = 'false'
endif
-elif _xvmc == 'true'
- if not system_has_kms_drm
- error('XVMC state tracker can only be build on DRM/KMS OSes.')
- elif not with_platform_x11
+elif not with_platform_x11
+ if _xvmc == 'true'
error('XVMC state tracker requires X11 support.')
- with_gallium_xvmc = false
- elif not (with_gallium_r600 or with_gallium_nouveau)
+ else
+ _xvmc = 'false'
+ endif
+elif not (with_gallium_r600 or with_gallium_nouveau)
+ if _xvmc == 'true'
error('XVMC state tracker requires at least one of the following gallium drivers: r600, nouveau.')
+ else
+ _xvmc = 'false'
endif
- dep_xvmc = dependency('xvmc', version : '>= 1.0.6')
- with_gallium_xvmc = true
-else
- with_gallium_xvmc = false
+elif _xvmc == 'auto'
+ _xvmc = 'true'
endif
+with_gallium_xvmc = _xvmc == 'true'
+dep_xvmc = []
if with_gallium_xvmc
+ dep_xvmc = dependency('xvmc', version : '>= 1.0.6')
dep_xvmc = declare_dependency(
compile_args : run_command(prog_pkgconfig, ['xvmc', '--cflags']).stdout().split()
)