diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py index 9614f1f0d..2ea8ed1eb 100644 --- a/mesonbuild/dependencies/misc.py +++ b/mesonbuild/dependencies/misc.py @@ -173,7 +173,12 @@ class BoostDependency(ExternalDependency): if self.is_found: self.detect_lib_modules() mlog.debug('Boost library directory is', mlog.bold(self.libdir)) - self.validate_requested() + for m in self.requested_modules: + if 'boost_' + m not in self.lib_modules: + mlog.debug('Requested Boost library {!r} not found'.format(m)) + self.log_fail() + self.is_found = False + return self.log_success() else: self.log_fail() @@ -262,12 +267,6 @@ class BoostDependency(ExternalDependency): raise DependencyException('Boost module argument is not a string.') return candidates - def validate_requested(self): - for m in self.requested_modules: - if 'boost_' + m not in self.lib_modules: - msg = 'Requested Boost library {!r} not found' - raise DependencyException(msg.format(m)) - def detect_version(self): try: version = self.compiler.get_define('BOOST_LIB_VERSION', '#include ', self.env, self.get_compile_args(), [])