From 545a42964677741f5a88763ace6e6062cf2d835b Mon Sep 17 00:00:00 2001 From: Tom Scogland Date: Tue, 1 Feb 2022 00:58:39 -0800 Subject: [PATCH] llvm: add llvm_config helper (#28670) Add a helper as a base to build better libs etc. methods --- var/spack/repos/builtin/packages/llvm/package.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/var/spack/repos/builtin/packages/llvm/package.py b/var/spack/repos/builtin/packages/llvm/package.py index 78b732519f..9aa085f66d 100644 --- a/var/spack/repos/builtin/packages/llvm/package.py +++ b/var/spack/repos/builtin/packages/llvm/package.py @@ -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