aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/dependencies
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2021-08-02 12:16:58 -0400
committerJussi Pakkanen <jpakkane@gmail.com>2021-08-03 00:16:47 +0300
commitde7bc71ee3a6ecc19fbeafe9cfd3629814ff46d0 (patch)
tree52eb970ba600cc3146114629e1ac4678f9444cac /mesonbuild/dependencies
parenta79980da6ba50ef9eaea396528c9c8a395c4997d (diff)
downloadmeson-de7bc71ee3a6ecc19fbeafe9cfd3629814ff46d0.zip
meson-de7bc71ee3a6ecc19fbeafe9cfd3629814ff46d0.tar.gz
meson-de7bc71ee3a6ecc19fbeafe9cfd3629814ff46d0.tar.bz2
Fix when gtest dep is found but does not pass version check
GTestDependencySystem (and other similar dep classes) sets self.is_found=True, but the version check could still fail. In the case the dependency is not required `ExternalDependency._check_version()` won't raise an exception and thus the dependency is accepted. _check_version() sets self.is_found() in the case self.version is not empty, we should do it too when self.version is empty. Fixes: #9036.
Diffstat (limited to 'mesonbuild/dependencies')
-rw-r--r--mesonbuild/dependencies/base.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py
index fd2b069..45aec75 100644
--- a/mesonbuild/dependencies/base.py
+++ b/mesonbuild/dependencies/base.py
@@ -363,6 +363,7 @@ class ExternalDependency(Dependency, HasNativeKwarg):
if self.version_reqs:
# an unknown version can never satisfy any requirement
if not self.version:
+ self.is_found = False
found_msg: mlog.TV_LoggableList = []
found_msg += ['Dependency', mlog.bold(self.name), 'found:']
found_msg += [mlog.red('NO'), 'unknown version, but need:', self.version_reqs]