dependency's wanted version might be a list

A dependency declared in a subproject should be able to behave as
a pkgconfig dependency, thus it should process the wanted version
as a list.
This commit is contained in:
Víctor Manuel Jáquez Leal 2018-03-20 16:36:29 +01:00 committed by Jussi Pakkanen
parent e9a7b0d2a9
commit 6f7f7c69a2
3 changed files with 16 additions and 1 deletions

View File

@ -2349,7 +2349,7 @@ to directly access options of other subprojects.''')
def check_subproject_version(wanted, found):
if wanted == 'undefined':
return True
if found == 'undefined' or not mesonlib.version_compare(found, wanted):
if found == 'undefined' or not mesonlib.version_compare_many(found, wanted)[0]:
return False
return True

View File

@ -0,0 +1,10 @@
project('subproject version', 'c',
version : '2.3.4',
license: 'mylicense')
subproject('a')
liba_dep = dependency('a',
fallback: ['a', 'liba_dep'],
version: ['>= 0.30.0', '!= 0.99.0'])

View File

@ -0,0 +1,5 @@
project('mysubproject', 'c',
version : '1.0.0',
license : 'sublicense')
liba_dep = declare_dependency (version : '1.0.0')