build: Factor out common gtkdoc flags

Those lists were getting very long. We can’t quite entirely automate the
list generation since Meson doesn’t have a range() function, but we can
at least combine three of them into one.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
Philip Withnall 2019-03-06 11:59:03 +00:00
parent 925c52760c
commit 6761bb2f57
5 changed files with 39 additions and 204 deletions

View File

@ -118,70 +118,6 @@ if get_option('gtk_doc')
]
endif
ignore_decorators = [
'GLIB_VAR',
'G_GNUC_INTERNAL',
'G_GNUC_WARN_UNUSED_RESULT',
'GLIB_AVAILABLE_IN_ALL',
'GLIB_AVAILABLE_IN_2_26',
'GLIB_AVAILABLE_IN_2_28',
'GLIB_AVAILABLE_IN_2_30',
'GLIB_AVAILABLE_IN_2_32',
'GLIB_AVAILABLE_IN_2_34',
'GLIB_AVAILABLE_IN_2_36',
'GLIB_AVAILABLE_IN_2_38',
'GLIB_AVAILABLE_IN_2_40',
'GLIB_AVAILABLE_IN_2_42',
'GLIB_AVAILABLE_IN_2_44',
'GLIB_AVAILABLE_IN_2_46',
'GLIB_AVAILABLE_IN_2_48',
'GLIB_AVAILABLE_IN_2_50',
'GLIB_AVAILABLE_IN_2_52',
'GLIB_AVAILABLE_IN_2_54',
'GLIB_AVAILABLE_IN_2_56',
'GLIB_AVAILABLE_IN_2_58',
'GLIB_AVAILABLE_IN_2_60',
'GLIB_AVAILABLE_IN_2_62',
'GLIB_DEPRECATED_IN_2_26',
'GLIB_DEPRECATED_IN_2_26_FOR',
'GLIB_DEPRECATED_IN_2_28',
'GLIB_DEPRECATED_IN_2_28_FOR',
'GLIB_DEPRECATED_IN_2_30',
'GLIB_DEPRECATED_IN_2_30_FOR',
'GLIB_DEPRECATED_IN_2_32',
'GLIB_DEPRECATED_IN_2_32_FOR',
'GLIB_DEPRECATED_IN_2_34',
'GLIB_DEPRECATED_IN_2_34_FOR',
'GLIB_DEPRECATED_IN_2_36',
'GLIB_DEPRECATED_IN_2_36_FOR',
'GLIB_DEPRECATED_IN_2_38',
'GLIB_DEPRECATED_IN_2_38_FOR',
'GLIB_DEPRECATED_IN_2_40',
'GLIB_DEPRECATED_IN_2_40_FOR',
'GLIB_DEPRECATED_IN_2_42',
'GLIB_DEPRECATED_IN_2_42_FOR',
'GLIB_DEPRECATED_IN_2_44',
'GLIB_DEPRECATED_IN_2_44_FOR',
'GLIB_DEPRECATED_IN_2_46',
'GLIB_DEPRECATED_IN_2_46_FOR',
'GLIB_DEPRECATED_IN_2_48',
'GLIB_DEPRECATED_IN_2_48_FOR',
'GLIB_DEPRECATED_IN_2_50',
'GLIB_DEPRECATED_IN_2_50_FOR',
'GLIB_DEPRECATED_IN_2_52',
'GLIB_DEPRECATED_IN_2_52_FOR',
'GLIB_DEPRECATED_IN_2_54',
'GLIB_DEPRECATED_IN_2_54_FOR',
'GLIB_DEPRECATED_IN_2_56',
'GLIB_DEPRECATED_IN_2_56_FOR',
'GLIB_DEPRECATED_IN_2_58',
'GLIB_DEPRECATED_IN_2_58_FOR',
'GLIB_DEPRECATED_IN_2_60',
'GLIB_DEPRECATED_IN_2_60_FOR',
'GLIB_DEPRECATED_IN_2_62',
'GLIB_DEPRECATED_IN_2_62_FOR',
]
# FIXME: More win32 headers were added to fix building gio-scan
# FIXME: ExampleAnimal docs aren't built
@ -201,10 +137,8 @@ if get_option('gtk_doc')
mode : 'none',
dependencies : [libgio_dep, libgobject_dep, libglib_dep],
src_dir : 'gio',
scan_args : [
scan_args : gtkdoc_common_scan_args + [
'--rebuild-types',
'--deprecated-guards=G_DISABLE_DEPRECATED',
'--ignore-decorators=' + '|'.join(ignore_decorators),
'--ignore-headers=' + ' '.join(ignore_headers),
],
content_files : [

View File

@ -40,70 +40,6 @@ if get_option('gtk_doc')
'gvalgrind.h',
]
ignore_decorators = [
'GLIB_VAR',
'G_GNUC_INTERNAL',
'G_GNUC_WARN_UNUSED_RESULT',
'GLIB_AVAILABLE_IN_ALL',
'GLIB_AVAILABLE_IN_2_26',
'GLIB_AVAILABLE_IN_2_28',
'GLIB_AVAILABLE_IN_2_30',
'GLIB_AVAILABLE_IN_2_32',
'GLIB_AVAILABLE_IN_2_34',
'GLIB_AVAILABLE_IN_2_36',
'GLIB_AVAILABLE_IN_2_38',
'GLIB_AVAILABLE_IN_2_40',
'GLIB_AVAILABLE_IN_2_42',
'GLIB_AVAILABLE_IN_2_44',
'GLIB_AVAILABLE_IN_2_46',
'GLIB_AVAILABLE_IN_2_48',
'GLIB_AVAILABLE_IN_2_50',
'GLIB_AVAILABLE_IN_2_52',
'GLIB_AVAILABLE_IN_2_54',
'GLIB_AVAILABLE_IN_2_56',
'GLIB_AVAILABLE_IN_2_58',
'GLIB_AVAILABLE_IN_2_60',
'GLIB_AVAILABLE_IN_2_62',
'GLIB_DEPRECATED_IN_2_26',
'GLIB_DEPRECATED_IN_2_26_FOR',
'GLIB_DEPRECATED_IN_2_28',
'GLIB_DEPRECATED_IN_2_28_FOR',
'GLIB_DEPRECATED_IN_2_30',
'GLIB_DEPRECATED_IN_2_30_FOR',
'GLIB_DEPRECATED_IN_2_32',
'GLIB_DEPRECATED_IN_2_32_FOR',
'GLIB_DEPRECATED_IN_2_34',
'GLIB_DEPRECATED_IN_2_34_FOR',
'GLIB_DEPRECATED_IN_2_36',
'GLIB_DEPRECATED_IN_2_36_FOR',
'GLIB_DEPRECATED_IN_2_38',
'GLIB_DEPRECATED_IN_2_38_FOR',
'GLIB_DEPRECATED_IN_2_40',
'GLIB_DEPRECATED_IN_2_40_FOR',
'GLIB_DEPRECATED_IN_2_42',
'GLIB_DEPRECATED_IN_2_42_FOR',
'GLIB_DEPRECATED_IN_2_44',
'GLIB_DEPRECATED_IN_2_44_FOR',
'GLIB_DEPRECATED_IN_2_46',
'GLIB_DEPRECATED_IN_2_46_FOR',
'GLIB_DEPRECATED_IN_2_48',
'GLIB_DEPRECATED_IN_2_48_FOR',
'GLIB_DEPRECATED_IN_2_50',
'GLIB_DEPRECATED_IN_2_50_FOR',
'GLIB_DEPRECATED_IN_2_52',
'GLIB_DEPRECATED_IN_2_52_FOR',
'GLIB_DEPRECATED_IN_2_54',
'GLIB_DEPRECATED_IN_2_54_FOR',
'GLIB_DEPRECATED_IN_2_56',
'GLIB_DEPRECATED_IN_2_56_FOR',
'GLIB_DEPRECATED_IN_2_58',
'GLIB_DEPRECATED_IN_2_58_FOR',
'GLIB_DEPRECATED_IN_2_60',
'GLIB_DEPRECATED_IN_2_60_FOR',
'GLIB_DEPRECATED_IN_2_62',
'GLIB_DEPRECATED_IN_2_62_FOR',
]
docpath = join_paths(glib_datadir, 'gtk-doc', 'html')
version_conf = configuration_data()
version_conf.set('GLIB_VERSION', meson.project_version())
@ -119,9 +55,7 @@ if get_option('gtk_doc')
mode : 'none',
src_dir : [ 'glib', 'gmodule' ],
dependencies : libglib_dep,
scan_args : [
'--deprecated-guards=G_DISABLE_DEPRECATED',
'--ignore-decorators=' + '|'.join(ignore_decorators),
scan_args : gtkdoc_common_scan_args + [
'--ignore-headers=' + ' '.join(ignore_headers),
],
content_files : [

View File

@ -10,70 +10,6 @@ if get_option('gtk_doc')
'glib-enumtypes.h',
]
ignore_decorators = [
'GLIB_VAR',
'G_GNUC_INTERNAL',
'G_GNUC_WARN_UNUSED_RESULT',
'GLIB_AVAILABLE_IN_ALL',
'GLIB_AVAILABLE_IN_2_26',
'GLIB_AVAILABLE_IN_2_28',
'GLIB_AVAILABLE_IN_2_30',
'GLIB_AVAILABLE_IN_2_32',
'GLIB_AVAILABLE_IN_2_34',
'GLIB_AVAILABLE_IN_2_36',
'GLIB_AVAILABLE_IN_2_38',
'GLIB_AVAILABLE_IN_2_40',
'GLIB_AVAILABLE_IN_2_42',
'GLIB_AVAILABLE_IN_2_44',
'GLIB_AVAILABLE_IN_2_46',
'GLIB_AVAILABLE_IN_2_48',
'GLIB_AVAILABLE_IN_2_50',
'GLIB_AVAILABLE_IN_2_52',
'GLIB_AVAILABLE_IN_2_54',
'GLIB_AVAILABLE_IN_2_56',
'GLIB_AVAILABLE_IN_2_58',
'GLIB_AVAILABLE_IN_2_60',
'GLIB_AVAILABLE_IN_2_62',
'GLIB_DEPRECATED_IN_2_26',
'GLIB_DEPRECATED_IN_2_26_FOR',
'GLIB_DEPRECATED_IN_2_28',
'GLIB_DEPRECATED_IN_2_28_FOR',
'GLIB_DEPRECATED_IN_2_30',
'GLIB_DEPRECATED_IN_2_30_FOR',
'GLIB_DEPRECATED_IN_2_32',
'GLIB_DEPRECATED_IN_2_32_FOR',
'GLIB_DEPRECATED_IN_2_34',
'GLIB_DEPRECATED_IN_2_34_FOR',
'GLIB_DEPRECATED_IN_2_36',
'GLIB_DEPRECATED_IN_2_36_FOR',
'GLIB_DEPRECATED_IN_2_38',
'GLIB_DEPRECATED_IN_2_38_FOR',
'GLIB_DEPRECATED_IN_2_40',
'GLIB_DEPRECATED_IN_2_40_FOR',
'GLIB_DEPRECATED_IN_2_42',
'GLIB_DEPRECATED_IN_2_42_FOR',
'GLIB_DEPRECATED_IN_2_44',
'GLIB_DEPRECATED_IN_2_44_FOR',
'GLIB_DEPRECATED_IN_2_46',
'GLIB_DEPRECATED_IN_2_46_FOR',
'GLIB_DEPRECATED_IN_2_48',
'GLIB_DEPRECATED_IN_2_48_FOR',
'GLIB_DEPRECATED_IN_2_50',
'GLIB_DEPRECATED_IN_2_50_FOR',
'GLIB_DEPRECATED_IN_2_52',
'GLIB_DEPRECATED_IN_2_52_FOR',
'GLIB_DEPRECATED_IN_2_54',
'GLIB_DEPRECATED_IN_2_54_FOR',
'GLIB_DEPRECATED_IN_2_56',
'GLIB_DEPRECATED_IN_2_56_FOR',
'GLIB_DEPRECATED_IN_2_58',
'GLIB_DEPRECATED_IN_2_58_FOR',
'GLIB_DEPRECATED_IN_2_60',
'GLIB_DEPRECATED_IN_2_60_FOR',
'GLIB_DEPRECATED_IN_2_62',
'GLIB_DEPRECATED_IN_2_62_FOR',
]
docpath = join_paths(glib_datadir, 'gtk-doc', 'html')
version_conf = configuration_data()
version_conf.set('GLIB_VERSION', meson.project_version())
@ -92,10 +28,8 @@ if get_option('gtk_doc')
dependencies : [libgobject_dep, libglib_dep],
include_directories : [gtkdocincl],
src_dir : 'gobject',
scan_args : [
scan_args : gtkdoc_common_scan_args + [
'--rebuild-types',
'--deprecated-guards=G_DISABLE_DEPRECATED',
'--ignore-decorators=' + '|'.join(ignore_decorators),
'--ignore-headers=' + ' '.join(ignore_headers),
],
content_files : [

View File

@ -0,0 +1,35 @@
# 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',
]
ignore_decorators = [
'GLIB_VAR',
'G_GNUC_INTERNAL',
'G_GNUC_WARN_UNUSED_RESULT',
'GLIB_AVAILABLE_IN_ALL',
]
foreach version : stable_2_series_versions
ignore_decorators += [
'GLIB_AVAILABLE_IN_2_' + version,
'GLIB_DEPRECATED_IN_2_' + version,
'GLIB_DEPRECATED_IN_2_' + version + '_FOR',
]
endforeach
gtkdoc_common_scan_args = [
'--deprecated-guards=G_DISABLE_DEPRECATED',
'--ignore-decorators=' + '|'.join(ignore_decorators),
]
subdir('gio')
subdir('glib')
subdir('gobject')

View File

@ -2045,6 +2045,4 @@ if get_option('man')
endif
gnome = import('gnome')
subdir('docs/reference/glib')
subdir('docs/reference/gobject')
subdir('docs/reference/gio')
subdir('docs/reference')