meson: cache get_target_generated_dir
This reduces the build time about 2 sec. The result itself is not hard
to calculate. However, persistent join calls with the same 2 strings are
not that usefull. This also caused about 600'000 calls to
get_target_dir, we are now down to 60'000 calls form this function to
get_target_dir.
@@ -26,6 +26,7 @@ from ..mesonlib import File
from ..compilers import CompilerArgs
from collections import OrderedDict
import shlex
+from functools import lru_cache
class CleanTrees:
@@ -210,6 +211,7 @@ class Backend:
def get_target_private_dir_abs(self, target):
return os.path.join(self.environment.get_build_dir(), self.get_target_private_dir(target))
+ @lru_cache(maxsize=None)
def get_target_generated_dir(self, target, gensrc, src):
"""
Takes a BuildTarget, a generator source (CustomTarget or GeneratedList),
