meson: Use range() instead of listing all stable versions

Note that range(), like in python, has start value included and stop
value excluded. That's why we use last_version + 2.
This commit is contained in:
Xavier Claessens 2022-05-11 14:34:00 -04:00
parent 06309d50ea
commit 5942103937

View File

@ -1,14 +1,8 @@
# The list of minor versions in the 2.x.x series which have had
# GLIB_AVAILABLE_IN_* macros. This should include the current unreleased stable
# version.
#
# FIXME: It would be good to be able to generate this list:
# https://github.com/mesonbuild/meson/issues/5026
stable_2_series_versions = [
'26', '28', '30', '32', '34', '36', '38',
'40', '42', '44', '46', '48', '50', '52', '54', '56', '58',
'60', '62', '64', '66', '68', '70', '72', '74',
]
first_version = 26
last_version = minor_version.is_odd() ? minor_version + 1 : minor_version
ignore_decorators = [
'GLIB_VAR',
@ -17,7 +11,8 @@ ignore_decorators = [
'GLIB_AVAILABLE_IN_ALL',
]
foreach version : stable_2_series_versions
foreach i : range(first_version, last_version + 2, 2)
version = i.to_string()
ignore_decorators += [
# Note that gtkdoc is going to use those in regex, and the longest match
# must come first. That's why '_FOR()' variant comes first.