llvm: add llvm_config helper (#28670)

Add a helper as a base to build better libs etc. methods
This commit is contained in:
Tom Scogland 2022-02-01 00:58:39 -08:00 committed by GitHub
parent bff5d253cf
commit 545a429646
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -714,6 +714,15 @@ def post_install(self):
with working_dir(self.build_directory): with working_dir(self.build_directory):
install_tree("bin", join_path(self.prefix, "libexec", "llvm")) install_tree("bin", join_path(self.prefix, "libexec", "llvm"))
def llvm_config(self, *args, **kwargs):
lc = Executable(self.prefix.bin.join('llvm-config'))
if not kwargs.get('output'):
kwargs['output'] = str
ret = lc(*args, **kwargs)
if kwargs.get('output') == "list":
return ret.split()
return ret
def get_llvm_targets_to_build(spec): def get_llvm_targets_to_build(spec):
targets = spec.variants['targets'].value targets = spec.variants['targets'].value