meson: cache the results of can_compile
the check for which files can be compiled are called again and again on
the same files over and over again. Caching this here shaves off 11s of
the build time of efl (which has grown in the last 3 versions to over 40
sec. again)
@@ -731,6 +731,7 @@ class Compiler:
return repr_str.format(self.__class__.__name__, self.version,
' '.join(self.exelist))
+ @lru_cache(maxsize=None)
def can_compile(self, src) -> bool:
if hasattr(src, 'fname'):
src = src.fname
