add auto to swr variant

This commit is contained in:
Omar Padron 2019-03-14 10:09:50 -04:00
parent 737c88c914
commit 2e7cd8a8ac

View File

@ -34,7 +34,9 @@ class Mesa(MesonPackage):
# Internal options
variant('llvm', default=True, description="Enable LLVM.")
variant('swr', values=any_combination_of('avx', 'avx2', 'knl', 'skx'),
variant('swr',
default='auto',
values=auto_or_any_combination_of('avx', 'avx2', 'knl', 'skx'),
description="Enable the SWR driver.")
# conflicts('~llvm', when='~swr=none')
@ -128,14 +130,17 @@ def meson_args(self):
else:
args.append('-Dllvm=false')
auto = ('swr=auto' in spec) and (
'x86' in spec.architecture.target.lower())
args_swr_arches = []
if 'swr=avx' in spec:
if 'swr=avx' in spec or auto:
args_swr_arches.append('avx')
if 'swr=avx2' in spec:
if 'swr=avx2' in spec or auto:
args_swr_arches.append('avx2')
if 'swr=knl' in spec:
if 'swr=knl' in spec or auto:
args_swr_arches.append('knl')
if 'swr=skx' in spec:
if 'swr=skx' in spec or auto:
args_swr_arches.append('skx')
if args_swr_arches:
if '+llvm' not in spec: