summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorBernhard Kaindl <43588962+bernhardkaindl@users.noreply.github.com>2021-11-16 08:07:48 +0100
committerGitHub <noreply@github.com>2021-11-16 08:07:48 +0100
commitada598668bda786646505bbdba2bee579af3f70f (patch)
treebbe630aa46bfbc19c03688f911485bcdf5cd2a3d /var
parent8c7fdadeba600f2cfa8b8e3a4af039b6a33a2fbd (diff)
downloadspack-ada598668bda786646505bbdba2bee579af3f70f.tar.gz
spack-ada598668bda786646505bbdba2bee579af3f70f.tar.bz2
spack-ada598668bda786646505bbdba2bee579af3f70f.tar.xz
spack-ada598668bda786646505bbdba2bee579af3f70f.zip
mesa: Use the llvm-config of spec['llvm'] for '+llvm' (#27235)
Fix builds on hosts where /usr/bin/llvm-config-* is found and provides an incompatible version: Ensure that the llvm-config of spec['llvm'] is used.
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/mesa/package.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/mesa/package.py b/var/spack/repos/builtin/packages/mesa/package.py
index cd1dc46b36..ba65b834ae 100644
--- a/var/spack/repos/builtin/packages/mesa/package.py
+++ b/var/spack/repos/builtin/packages/mesa/package.py
@@ -169,6 +169,16 @@ class Mesa(MesonPackage):
args.append(opt_enable(num_frontends > 1, 'shared-glapi'))
if '+llvm' in spec:
+ # Fix builds on hosts where /usr/bin/llvm-config-* is found and provides an
+ # incompatible version. Ensure that the llvm-config of spec['llvm'] is used.
+ args.append('--native-file')
+ args.append('meson-native-config.ini')
+ mkdirp(self.build_directory)
+ with working_dir(self.build_directory):
+ with open('meson-native-config.ini', 'w') as native_config:
+ llvm_config = spec['llvm'].prefix.bin + '/llvm-config'
+ native_config.write('[binaries]\n')
+ native_config.write("llvm-config = '{0}'\n".format(llvm_config))
args.append('-Dllvm=enabled')
args.append(opt_enable(
'+link_dylib' in spec['llvm'], 'shared-llvm'))