Merge pull request #610 from centricular/version-check-not-found-dep
dependency: Fix version check for a not-found dependency
This commit is contained in:
commit
ba4f26f8bf
|
@ -1644,7 +1644,7 @@ class Interpreter():
|
||||||
if 'version' in kwargs:
|
if 'version' in kwargs:
|
||||||
wanted = kwargs['version']
|
wanted = kwargs['version']
|
||||||
found = cached_dep.get_version()
|
found = cached_dep.get_version()
|
||||||
if not found or not mesonlib.version_compare(found, wanted):
|
if not cached_dep.found() or not mesonlib.version_compare(found, wanted):
|
||||||
# Cached dep has the wrong version. Check if an external
|
# Cached dep has the wrong version. Check if an external
|
||||||
# dependency or a fallback dependency provides it.
|
# dependency or a fallback dependency provides it.
|
||||||
cached_dep = None
|
cached_dep = None
|
||||||
|
|
|
@ -9,6 +9,10 @@ assert(zlib.version() == zlibver.version(), 'zlib versions did not match!')
|
||||||
zlibver = dependency('zlib', version : '<1.0', required : false)
|
zlibver = dependency('zlib', version : '<1.0', required : false)
|
||||||
assert(zlibver.found() == false, 'zlib <1.0 should not be found!')
|
assert(zlibver.found() == false, 'zlib <1.0 should not be found!')
|
||||||
|
|
||||||
|
# Test https://github.com/mesonbuild/meson/pull/610
|
||||||
|
dependency('somebrokenlib', version : '>=2.0', required : false)
|
||||||
|
dependency('somebrokenlib', version : '>=1.0', required : false)
|
||||||
|
|
||||||
# Find internal dependency without version
|
# Find internal dependency without version
|
||||||
somelibver = dependency('somelib',
|
somelibver = dependency('somelib',
|
||||||
fallback : ['somelibnover', 'some_dep'])
|
fallback : ['somelibnover', 'some_dep'])
|
||||||
|
|
Loading…
Reference in New Issue