mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-21 04:00:09 +01:00
build: fix errors when building with gtk-doc 1.32
gtkdoc-scan 1.32 performs stricter checks on structures definitions
and so it complains on:
/build/networkmanager/src/NetworkManager/libnm/./nm-vpn-plugin-old.h:0: warning: partial declaration (struct) : typedef struct {
NM_DEPRECATED_IN_1_2
GObject parent;
} NMVpnPluginOld NM_DEPRECATED_IN_1_2;
because of the unrecognized token 'NM_DEPRECATED_IN_1_2'.
Pass all allowed macros to gtkdoc-scan through the --ignore-decorators
argument.
https://gitlab.gnome.org/GNOME/gtk-doc/issues/98
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/238
This commit is contained in:
parent
de6f0bc6db
commit
2d941dc95a
3 changed files with 14 additions and 1 deletions
|
|
@ -18,8 +18,10 @@ DOC_SOURCE_DIR= \
|
||||||
$(top_srcdir)/libnm \
|
$(top_srcdir)/libnm \
|
||||||
$(top_builddir)/libnm
|
$(top_builddir)/libnm
|
||||||
|
|
||||||
|
decorators := $(shell $(top_srcdir)/tools/decorators.sh $(top_srcdir)/libnm-core/nm-version.h)
|
||||||
|
|
||||||
# Extra options to supply to gtkdoc-scan.
|
# Extra options to supply to gtkdoc-scan.
|
||||||
SCAN_OPTIONS=--rebuild-types --rebuild-sections
|
SCAN_OPTIONS=--rebuild-types --rebuild-sections --ignore-decorators "$(decorators)"
|
||||||
|
|
||||||
# Extra options to supply to gtkdoc-mkdb.
|
# Extra options to supply to gtkdoc-mkdb.
|
||||||
MKDB_OPTIONS=--sgml-mode --output-format=xml
|
MKDB_OPTIONS=--sgml-mode --output-format=xml
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,9 @@ configure_file(
|
||||||
configuration: version_conf,
|
configuration: version_conf,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
result = run_command(join_paths(meson.source_root(), 'tools', 'decorators.sh'),
|
||||||
|
join_paths(meson.source_root(), 'libnm-core', 'nm-version.h'))
|
||||||
|
|
||||||
gnome.gtkdoc(
|
gnome.gtkdoc(
|
||||||
doc_module,
|
doc_module,
|
||||||
main_xml: doc_module + '-docs.xml',
|
main_xml: doc_module + '-docs.xml',
|
||||||
|
|
@ -43,6 +46,7 @@ gnome.gtkdoc(
|
||||||
scan_args: [
|
scan_args: [
|
||||||
'--rebuild-types',
|
'--rebuild-types',
|
||||||
'--rebuild-sections',
|
'--rebuild-sections',
|
||||||
|
'--ignore-decorators=' + result.stdout().strip(),
|
||||||
'--ignore-headers=' + ' '.join(private_headers),
|
'--ignore-headers=' + ' '.join(private_headers),
|
||||||
],
|
],
|
||||||
scanobjs_args: '--type-init-func="g_type_init();"',
|
scanobjs_args: '--type-init-func="g_type_init();"',
|
||||||
|
|
|
||||||
7
tools/decorators.sh
Executable file
7
tools/decorators.sh
Executable file
|
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Extract NM_DEPRECATED_IN_* and NM_AVAILABLE_IN_* macros from a
|
||||||
|
# header file and output them in a way suitable to be passed to
|
||||||
|
# 'gtkdoc-scan --ignore-decorators'
|
||||||
|
|
||||||
|
grep -o "NM_DEPRECATED_IN_[0-9]_[0-9]\+$\|NM_AVAILABLE_IN_[0-9]_[0-9]\+$" "$1" | sed ':a;N;$!ba;s/\n/|/g'
|
||||||
Loading…
Add table
Reference in a new issue