aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/environment.py
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-06-01 11:44:23 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2019-06-03 20:37:27 +0300
commitd6407445b9aabfa90b23ef1da6b0e903b4e6b9e0 (patch)
tree6aef2ef5d54ffbcae90fb26c364bd3b488a9483a /mesonbuild/environment.py
parent93f04033c1387519038998584c013ce60bf5301d (diff)
downloadmeson-d6407445b9aabfa90b23ef1da6b0e903b4e6b9e0.zip
meson-d6407445b9aabfa90b23ef1da6b0e903b4e6b9e0.tar.gz
meson-d6407445b9aabfa90b23ef1da6b0e903b4e6b9e0.tar.bz2
backend: refactor get_custom_target_provided_libraries
the problem here is, that get_custom_target_provided_libraries iterated over all generated sources of a target. In each output we check if this is a library or not. In projects like EFL we have added a lot of generated target to many different targets, so the iterating of the output is rather consistent, with this commit we drop from 19% of the time spending in get_custom_target_provided_libraries down to 3.51%.
Diffstat (limited to 'mesonbuild/environment.py')
-rw-r--r--mesonbuild/environment.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
index 6b536a4..ff4a6b1 100644
--- a/mesonbuild/environment.py
+++ b/mesonbuild/environment.py
@@ -38,6 +38,7 @@ from .compilers import (
is_object,
is_source,
)
+from functools import lru_cache
from .compilers import (
ArmCCompiler,
ArmCPPCompiler,
@@ -572,6 +573,7 @@ class Environment:
def is_object(self, fname):
return is_object(fname)
+ @lru_cache(maxsize=None)
def is_library(self, fname):
return is_library(fname)