summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny McClanahan <1305167+cosmicexplorer@users.noreply.github.com>2021-10-06 17:07:42 +0000
committerGitHub <noreply@github.com>2021-10-06 10:07:42 -0700
commite2e8e5c1e2cee58d95445236c43813858a31ab70 (patch)
treee885ff2f7d53501e99f3a6de5b489a98a3565783
parentfefe624141b671f16b420fc8880f7e4208ce48da (diff)
downloadspack-e2e8e5c1e2cee58d95445236c43813858a31ab70.tar.gz
spack-e2e8e5c1e2cee58d95445236c43813858a31ab70.tar.bz2
spack-e2e8e5c1e2cee58d95445236c43813858a31ab70.tar.xz
spack-e2e8e5c1e2cee58d95445236c43813858a31ab70.zip
use conflicts() instead of referring to SpecError in mesa (#26562)
* mesa: use conflicts() instead of referring to SpecError
-rw-r--r--var/spack/repos/builtin/packages/mesa/package.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/var/spack/repos/builtin/packages/mesa/package.py b/var/spack/repos/builtin/packages/mesa/package.py
index 02c5f7d132..5e678010e4 100644
--- a/var/spack/repos/builtin/packages/mesa/package.py
+++ b/var/spack/repos/builtin/packages/mesa/package.py
@@ -39,11 +39,15 @@ class Mesa(MesonPackage):
# Internal options
variant('llvm', default=True, description="Enable LLVM.")
- variant('swr', default='auto',
- values=('auto', 'none', 'avx', 'avx2', 'knl', 'skx'),
+ _SWR_AUTO_VALUE = 'auto'
+ _SWR_ENABLED_VALUES = (_SWR_AUTO_VALUE, 'avx', 'avx2', 'knl', 'skx')
+ _SWR_DISABLED_VALUES = ('none',)
+ variant('swr', default=_SWR_AUTO_VALUE,
+ values=_SWR_DISABLED_VALUES + _SWR_ENABLED_VALUES,
multi=True,
description="Enable the SWR driver.")
- # conflicts('~llvm', when='~swr=none')
+ for swr_enabled_value in _SWR_ENABLED_VALUES:
+ conflicts('~llvm', when='swr={0}'.format(swr_enabled_value))
# Front ends
variant('osmesa', default=True, description="Enable the OSMesa frontend.")
@@ -192,8 +196,6 @@ class Mesa(MesonPackage):
args_swr_arches.append('skx')
if args_swr_arches:
- if '+llvm' not in spec:
- raise SpecError('Variant swr requires +llvm')
args_gallium_drivers.append('swr')
args.append('-Dswr-arches=' + ','.join(args_swr_arches))