Fix performance regression in build file generation

Re-use any already determined rpaths for a target.

Fixes #9695
This commit is contained in:
complexoctonion 2021-12-06 10:59:43 +01:00 committed by Eli Schwartz
parent a21c7d54fb
commit 798f5ef178
1 changed files with 2 additions and 1 deletions

View File

@ -748,7 +748,8 @@ class Backend:
raise MesonException(f'Invalid arg for --just-symbols, {dir} is a directory.')
return dirs
def rpaths_for_bundled_shared_libraries(self, target: build.BuildTarget, exclude_system: bool = True) -> T.List[str]:
@lru_cache(maxsize=None)
def rpaths_for_bundled_shared_libraries(self, target: build.BuildTarget, exclude_system: bool = True) -> 'ImmutableListProtocol[str]':
paths: T.List[str] = []
for dep in target.external_deps:
if not isinstance(dep, (dependencies.ExternalLibrary, dependencies.PkgConfigDependency)):