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.
pull/4394/merge
Marcel Hollerbach 6 years ago committed by Jussi Pakkanen
parent 388108aa88
commit 468d1a05ec
  1. 2
      mesonbuild/backend/backends.py

@ -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),

Loading…
Cancel
Save