iwyu: link clang resources in the right location (#23885)

iwyu cannot find clang's headers if they are installed in separate
prefixes, see:
https://github.com/include-what-you-use/include-what-you-use#how-to-install
This commit is contained in:
Michael Kuhn 2021-05-25 17:01:44 +02:00 committed by GitHub
parent c9b957b71a
commit 29deb399b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,3 +44,10 @@ class Iwyu(CMakePackage):
def cmake_args(self):
return [self.define('CMAKE_CXX_STANDARD', 14),
self.define('CMAKE_CXX_EXTENSIONS', False)]
@run_after('install')
def link_resources(self):
# iwyu needs to find Clang's headers
# https://github.com/include-what-you-use/include-what-you-use/blob/master/README.md#how-to-install
mkdir(self.prefix.lib)
symlink(self.spec['llvm'].prefix.lib.clang, self.prefix.lib.clang)