diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2021-08-02 12:16:58 -0400 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2021-08-03 00:16:47 +0300 |
commit | de7bc71ee3a6ecc19fbeafe9cfd3629814ff46d0 (patch) | |
tree | 52eb970ba600cc3146114629e1ac4678f9444cac | |
parent | a79980da6ba50ef9eaea396528c9c8a395c4997d (diff) | |
download | meson-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.
-rw-r--r-- | mesonbuild/dependencies/base.py | 1 |
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] |