From 7825a6f2ca754cb31ef822dc655abaf867a9b187 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Thu, 30 Sep 2021 20:36:08 -0400 Subject: [PATCH] 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. --- mesonbuild/modules/cmake.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mesonbuild/modules/cmake.py b/mesonbuild/modules/cmake.py index 53beded40..94f90fae5 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}')