llvm: Add modules to libs check

Which is required for statically linking with LLVM.
pull/2444/head
Dylan Baker 7 years ago
parent 3e004ae611
commit 6cbbbd546e
  1. 4
      mesonbuild/dependencies/dev.py

@ -137,6 +137,7 @@ class LLVMDependency(ExternalDependency):
# the C linker works fine if only using the C API.
super().__init__('llvm-config', environment, 'cpp', kwargs)
self.provided_modules = []
self.required_modules = set()
self.llvmconfig = None
self.__best_found = None
# FIXME: Support multiple version requirements ala PkgConfigDependency
@ -180,7 +181,7 @@ class LLVMDependency(ExternalDependency):
self.check_components(opt_modules, required=False)
p, out = Popen_safe(
[self.llvmconfig, '--libs', '--ldflags'])[:2]
[self.llvmconfig, '--libs', '--ldflags'] + list(self.required_modules))[:2]
if p.returncode != 0:
raise DependencyException('Could not generate libs for LLVM.')
self.link_args = strip_system_libdirs(environment, shlex.split(out))
@ -206,6 +207,7 @@ class LLVMDependency(ExternalDependency):
raise DependencyException(
'Could not find required LLVM Component: {}'.format(mod))
else:
self.required_modules.add(mod)
mlog.log('LLVM module', mod, 'found:', mlog.green('YES'))
def check_llvmconfig(self, version_req):

Loading…
Cancel
Save