From a8694f4b261fbe3a854d2a2d72742fde9a67d4b3 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Wed, 8 Aug 2018 00:12:06 +0530 Subject: Don't check version for fallback not-found dependency Otherwise we get an error while checking the subproject version: Uncomparable version string 'none'. If the dependency was found as a not-found dependency in the subproject and is not required, just take it. --- mesonbuild/interpreter.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'mesonbuild/interpreter.py') diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index 3df3a45..fd0385d 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -2816,6 +2816,12 @@ external dependencies (including libraries) must go to "dependencies".''') if not dep: return False found = dep.version_method([], {}) + # Don't do a version check if the dependency is not found and not required + if found == 'none' and not required: + subproj_path = os.path.join(self.subproject_dir, dirname) + mlog.log('Dependency', mlog.bold(name), 'from subproject', + mlog.bold(subproj_path), 'found:', mlog.red('NO'), '(cached)') + return dep if self.check_subproject_version(wanted, found): subproj_path = os.path.join(self.subproject_dir, dirname) mlog.log('Dependency', mlog.bold(name), 'from subproject', -- cgit v1.1