Skip to content

Commit

Permalink
llvm: add llvm_config helper (spack#28670)
Browse files Browse the repository at this point in the history
Add a helper as a base to build better libs etc. methods
  • Loading branch information
trws authored Feb 1, 2022
1 parent bff5d25 commit 545a429
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions var/spack/repos/builtin/packages/llvm/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,15 @@ def post_install(self):
with working_dir(self.build_directory):
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):
targets = spec.variants['targets'].value
Expand Down

0 comments on commit 545a429

Please sign in to comment.