Allow features added in 0.nn.0 to be used when version constraint is '>=0.nn'

pull/4017/head
Jon Turney 7 years ago
parent 8d3881a042
commit eb260f6141
  1. 14
      mesonbuild/mesonlib.py

@ -509,6 +509,20 @@ def version_compare_condition_with_min(condition, minimum):
return True
else:
cmpop = operator.le
# Declaring a project(meson_version: '>=0.46') and then using features in
# 0.46.0 is valid, because (knowing the meson versioning scheme) '0.46.0' is
# the lowest version which satisfies the constraint '>=0.46'.
#
# But this will fail here, because the minimum version required by the
# version constraint ('0.46') is strictly less (in our version comparison)
# than the minimum version needed for the feature ('0.46.0').
#
# Map versions in the constraint of the form '0.46' to '0.46.0', to embed
# this knowledge of the meson versioning scheme.
if re.match('^\d+.\d+$', condition):
condition += '.0'
return cmpop(Version(minimum), Version(condition))
def default_libdir():

Loading…
Cancel
Save