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.
pull/3194/merge
Víctor Manuel Jáquez Leal 7 years ago committed by Jussi Pakkanen
parent e9a7b0d2a9
commit 6f7f7c69a2
  1. 2
      mesonbuild/interpreter.py
  2. 10
      test cases/common/187 subproject version/meson.build
  3. 5
      test cases/common/187 subproject version/subprojects/a/meson.build

@ -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

@ -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'])

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