Skip to content

Commit 2e7cd8a

Browse files
author
Omar Padron
committed
add auto to swr variant
1 parent 737c88c commit 2e7cd8a

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

var/spack/repos/builtin/packages/mesa/package.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ class Mesa(MesonPackage):
3434

3535
# Internal options
3636
variant('llvm', default=True, description="Enable LLVM.")
37-
variant('swr', values=any_combination_of('avx', 'avx2', 'knl', 'skx'),
37+
variant('swr',
38+
default='auto',
39+
values=auto_or_any_combination_of('avx', 'avx2', 'knl', 'skx'),
3840
description="Enable the SWR driver.")
3941
# conflicts('~llvm', when='~swr=none')
4042

@@ -128,14 +130,17 @@ def meson_args(self):
128130
else:
129131
args.append('-Dllvm=false')
130132

133+
auto = ('swr=auto' in spec) and (
134+
'x86' in spec.architecture.target.lower())
135+
131136
args_swr_arches = []
132-
if 'swr=avx' in spec:
137+
if 'swr=avx' in spec or auto:
133138
args_swr_arches.append('avx')
134-
if 'swr=avx2' in spec:
139+
if 'swr=avx2' in spec or auto:
135140
args_swr_arches.append('avx2')
136-
if 'swr=knl' in spec:
141+
if 'swr=knl' in spec or auto:
137142
args_swr_arches.append('knl')
138-
if 'swr=skx' in spec:
143+
if 'swr=skx' in spec or auto:
139144
args_swr_arches.append('skx')
140145
if args_swr_arches:
141146
if '+llvm' not in spec:

0 commit comments

Comments
 (0)