aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2019-01-30 22:15:27 +0530
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2019-01-31 20:12:21 +0530
commit87652c80dcbf7fbf61e3883aec74b2271c65b041 (patch)
tree2cdbdf3e1b446a0ea5847a55527ef528a7776c11
parent00b59c9ad6cf4496c8aecc1d4de85f4828a2b701 (diff)
downloadmeson-87652c80dcbf7fbf61e3883aec74b2271c65b041.zip
meson-87652c80dcbf7fbf61e3883aec74b2271c65b041.tar.gz
meson-87652c80dcbf7fbf61e3883aec74b2271c65b041.tar.bz2
cmake deps: Again, get_command() is None when not found
This is showing up now that we've stopped swallowing exceptions whole-sale in the previous commit.
-rw-r--r--mesonbuild/dependencies/base.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py
index 53afb46..d56b825 100644
--- a/mesonbuild/dependencies/base.py
+++ b/mesonbuild/dependencies/base.py
@@ -972,16 +972,15 @@ class CMakeDependency(ExternalDependency):
# Only search for CMake the first time and store the result in the class
# definition
if CMakeDependency.class_cmakebin[for_machine] is False:
- mlog.debug('CMake binary for %s is cached missing.' % for_machine)
+ mlog.debug('CMake binary for %s is cached as not found' % for_machine)
elif CMakeDependency.class_cmakebin[for_machine] is not None:
mlog.debug('CMake binary for %s is cached.' % for_machine)
else:
assert CMakeDependency.class_cmakebin[for_machine] is None
- mlog.debug('CMake binary for %s is not cached.', for_machine)
+ mlog.debug('CMake binary for %s is not cached' % for_machine)
for potential_cmakebin in search():
- mlog.debug(
- 'Trying CMake binary %s for machine %s at %s.',
- potential_cmakebin.name, for_machine, potential_cmakebin.command)
+ mlog.debug('Trying CMake binary {} for machine {} at {}'
+ .format(potential_cmakebin.name, for_machine, potential_cmakebin.command))
version_if_ok = self.check_cmake(potential_cmakebin)
if not version_if_ok:
continue
@@ -1007,6 +1006,7 @@ class CMakeDependency(ExternalDependency):
if self.required:
raise DependencyException(msg)
mlog.debug(msg)
+ return
modules = kwargs.get('modules', [])
if not isinstance(modules, list):
@@ -1485,8 +1485,7 @@ set(CMAKE_SIZEOF_VOID_P "{}")
def check_cmake(self, cmakebin):
if not cmakebin.found():
- mlog.log('Did not find CMake {!r}'
- ''.format(' '.join(cmakebin.get_command())))
+ mlog.log('Did not find CMake {!r}'.format(cmakebin.name))
return None
try:
p, out = Popen_safe(cmakebin.get_command() + ['--version'])[0:2]