aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/compilers.py
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2022-03-18 21:27:54 -0400
committerEli Schwartz <eschwartz93@gmail.com>2022-10-25 17:24:56 -0400
commite68fcac919b332c7f9469672a243d2aab1bfea0a (patch)
tree40da43e7c28f22a156246abb303e2d949636bc9b /mesonbuild/compilers/compilers.py
parent2961adb8c89fa8ccfbc8e24cd9f1115bd3abeee1 (diff)
downloadmeson-e68fcac919b332c7f9469672a243d2aab1bfea0a.zip
meson-e68fcac919b332c7f9469672a243d2aab1bfea0a.tar.gz
meson-e68fcac919b332c7f9469672a243d2aab1bfea0a.tar.bz2
compilers: Make sure to not use ccache in compiler checks
ccache was used in all command lines but disabled using CCACHE_DISABLE in Compiler.compile() method. Wrapping invokations still has a cost, especially on Windows. With sccache things are even worse because CCACHE_DISABLE was not respected at all, making configure *extremely* slow on Windows when sccache is installed.
Diffstat (limited to 'mesonbuild/compilers/compilers.py')
-rw-r--r--mesonbuild/compilers/compilers.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py
index bcd5820..771d543 100644
--- a/mesonbuild/compilers/compilers.py
+++ b/mesonbuild/compilers/compilers.py
@@ -503,6 +503,7 @@ class Compiler(HoldableObject, metaclass=abc.ABCMeta):
linker: T.Optional['DynamicLinker'] = None,
full_version: T.Optional[str] = None, is_cross: bool = False):
self.exelist = ccache + exelist
+ self.exelist_no_ccache = exelist
# In case it's been overridden by a child class already
if not hasattr(self, 'file_suffixes'):
self.file_suffixes = lang_suffixes[self.language]
@@ -593,8 +594,8 @@ class Compiler(HoldableObject, metaclass=abc.ABCMeta):
def symbols_have_underscore_prefix(self, env: 'Environment') -> bool:
raise EnvironmentException('%s does not support symbols_have_underscore_prefix ' % self.get_id())
- def get_exelist(self) -> T.List[str]:
- return self.exelist.copy()
+ def get_exelist(self, ccache: bool = True) -> T.List[str]:
+ return self.exelist.copy() if ccache else self.exelist_no_ccache.copy()
def get_linker_exelist(self) -> T.List[str]:
return self.linker.get_exelist()
@@ -815,7 +816,7 @@ class Compiler(HoldableObject, metaclass=abc.ABCMeta):
if extra_args:
commands += extra_args
# Generate full command-line with the exelist
- command_list = self.get_exelist() + commands.to_native()
+ command_list = self.get_exelist(ccache=not no_ccache) + commands.to_native()
mlog.debug('Running compile:')
mlog.debug('Working directory: ', tmpdirname)
mlog.debug('Command line: ', ' '.join(command_list), '\n')