llvm: add libs property (#28621)

* llvm: add libs property

* Use llvm-config helper for libs property
This commit is contained in:
Glenn Johnson 2022-02-17 13:52:49 -06:00 committed by GitHub
parent fefe65a35b
commit e7e6a16064
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -476,6 +476,11 @@ def f77(self):
result = os.path.join(self.spec.prefix.bin, 'flang')
return result
@property
def libs(self):
return LibraryList(self.llvm_config("--libfiles", "all",
result="list"))
@run_before('cmake')
def codesign_check(self):
if self.spec.satisfies("+code_signing"):
@ -721,8 +726,9 @@ def llvm_config(self, *args, **kwargs):
if not kwargs.get('output'):
kwargs['output'] = str
ret = lc(*args, **kwargs)
if kwargs.get('output') == "list":
if kwargs.get('result') == "list":
return ret.split()
else:
return ret