aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/envconfig.py
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/envconfig.py')
-rw-r--r--mesonbuild/envconfig.py16
1 files changed, 6 insertions, 10 deletions
diff --git a/mesonbuild/envconfig.py b/mesonbuild/envconfig.py
index e211945..d3b1989 100644
--- a/mesonbuild/envconfig.py
+++ b/mesonbuild/envconfig.py
@@ -327,17 +327,13 @@ class BinaryTable(HasEnvVarFallback):
'pkgconfig': 'PKG_CONFIG',
}
- @classmethod
- def detect_ccache(cls):
+ @staticmethod
+ def detect_ccache():
try:
- has_ccache = subprocess.call(['ccache', '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
- except OSError:
- has_ccache = 1
- if has_ccache == 0:
- cmdlist = ['ccache']
- else:
- cmdlist = []
- return cmdlist
+ subprocess.check_call(['ccache', '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ except (OSError, subprocess.CalledProcessError):
+ return []
+ return ['ccache']
@classmethod
def _warn_about_lang_pointing_to_cross(cls, compiler_exe, evar):