aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2021-09-30 20:36:08 -0400
committerDaniel Mensinger <daniel@mensinger-ka.de>2021-10-03 12:34:01 +0200
commit7825a6f2ca754cb31ef822dc655abaf867a9b187 (patch)
treebebee4274c5e143e4907976434f265bc5b10c82f
parent3feaea6b29197cd224fbce0ac65fd43d08c3beac (diff)
downloadmeson-7825a6f2ca754cb31ef822dc655abaf867a9b187.zip
meson-7825a6f2ca754cb31ef822dc655abaf867a9b187.tar.gz
meson-7825a6f2ca754cb31ef822dc655abaf867a9b187.tar.bz2
cmake module: if cmake cannot be found, do not traceback
We ended up passing a NoneType as the program binary, which is a very awkward way to communicate an error when failing to write a basic package version file.
-rw-r--r--mesonbuild/modules/cmake.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/mesonbuild/modules/cmake.py b/mesonbuild/modules/cmake.py
index 53beded..94f90fa 100644
--- a/mesonbuild/modules/cmake.py
+++ b/mesonbuild/modules/cmake.py
@@ -238,6 +238,9 @@ class CmakeModule(ExtensionModule):
return True
cmakebin = ExternalProgram('cmake', silent=False)
+ if not cmakebin.found():
+ return False
+
p, stdout, stderr = mesonlib.Popen_safe(cmakebin.get_command() + ['--system-information', '-G', 'Ninja'])[0:3]
if p.returncode != 0:
mlog.log(f'error retrieving cmake information: returnCode={p.returncode} stdout={stdout} stderr={stderr}')