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.
This commit is contained in:
Bernhard Kaindl 2021-11-16 08:07:48 +01:00 committed by GitHub
parent 8c7fdadeba
commit ada598668b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -169,6 +169,16 @@ def meson_args(self):
args.append(opt_enable(num_frontends > 1, 'shared-glapi')) args.append(opt_enable(num_frontends > 1, 'shared-glapi'))
if '+llvm' in spec: 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('-Dllvm=enabled')
args.append(opt_enable( args.append(opt_enable(
'+link_dylib' in spec['llvm'], 'shared-llvm')) '+link_dylib' in spec['llvm'], 'shared-llvm'))