diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2016-11-01 12:13:36 +0000 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2016-11-01 14:11:48 +0000 |
commit | e226d702bc0ae0dbe15872a54e0743b197b37851 (patch) | |
tree | f84486bf798bff5339d88b2a98060c3c2c087cef /mesonbuild | |
parent | 6eeecb8585aed84759f968efb315e97db0cc8e52 (diff) | |
download | meson-e226d702bc0ae0dbe15872a54e0743b197b37851.zip meson-e226d702bc0ae0dbe15872a54e0743b197b37851.tar.gz meson-e226d702bc0ae0dbe15872a54e0743b197b37851.tar.bz2 |
gtkdoc: Add `ignore_headers` positional argument
Not all headers are public, or contain public types. GTK-Doc allows
adding headers to be ignored during the "scan" phase, by passing the
`--ignore-headers` command line argument to gtkdoc-scan.
Currently, you can do something like:
ignored_headers = [ 'foo-private.h', 'bar-private.h', ]
gnome.gtkdoc(...
scan_args: [
'--ignore-headers=' + ' '.join(ignored_headers),
],
...)
But it does not guarantee escaping rules and it's definitely not nice.
We can add a simpler version of that mechanism through a new positional
argument, `ignore_headers`, which behaves like `content_files` or
`html_assets`, and takes an array of header files to ignore:
gnome.gtkdoc(...
ignore_headers: ignored_headers,
...)
Diffstat (limited to 'mesonbuild')
-rw-r--r-- | mesonbuild/modules/gnome.py | 1 | ||||
-rwxr-xr-x | mesonbuild/scripts/gtkdochelper.py | 9 |
2 files changed, 7 insertions, 3 deletions
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py index 4ce8a4a..89d41c5 100644 --- a/mesonbuild/modules/gnome.py +++ b/mesonbuild/modules/gnome.py @@ -568,6 +568,7 @@ class GnomeModule: args += self.unpack_args('--fixxrefargs=', 'fixxref_args', kwargs) args += self.unpack_args('--html-assets=', 'html_assets', kwargs, state) args += self.unpack_args('--content-files=', 'content_files', kwargs, state) + args += self.unpack_args('--ignore-headers=', 'ignore_headers', kwargs) args += self.unpack_args('--installdir=', 'install_dir', kwargs, state) args += self.get_build_args(kwargs, state) res = [build.RunTarget(targetname, command[0], command[1:] + args, [], state.subdir)] diff --git a/mesonbuild/scripts/gtkdochelper.py b/mesonbuild/scripts/gtkdochelper.py index 4f8a9a5..220801d 100755 --- a/mesonbuild/scripts/gtkdochelper.py +++ b/mesonbuild/scripts/gtkdochelper.py @@ -39,6 +39,7 @@ parser.add_argument('--ldflags', dest='ldflags', default='') parser.add_argument('--cflags', dest='cflags', default='') parser.add_argument('--content-files', dest='content_files', default='') parser.add_argument('--html-assets', dest='html_assets', default='') +parser.add_argument('--ignore-headers', dest='ignore_headers', default='') parser.add_argument('--installdir', dest='install_dir') def gtkdoc_run_check(cmd, cwd): @@ -56,7 +57,7 @@ def gtkdoc_run_check(cmd, cwd): def build_gtkdoc(source_root, build_root, doc_subdir, src_subdir, main_file, module, html_args, scan_args, fixxref_args, gobject_typesfile, scanobjs_args, ld, cc, ldflags, cflags, - html_assets, content_files): + html_assets, content_files, ignore_headers): print("Building documentation for %s" % module) abs_src = os.path.join(source_root, src_subdir) @@ -91,7 +92,8 @@ def build_gtkdoc(source_root, build_root, doc_subdir, src_subdir, scan_cmd = ['gtkdoc-scan', '--module=' + module, - '--source-dir=' + abs_src] + scan_args + '--source-dir=' + abs_src, + '--ignore-headers=' + ignore_headers] + scan_args gtkdoc_run_check(scan_cmd, abs_out) if gobject_typesfile: @@ -176,7 +178,8 @@ def run(args): options.ldflags, options.cflags, options.html_assets.split('@@') if options.html_assets else [], - options.content_files.split('@@') if options.content_files else []) + options.content_files.split('@@') if options.content_files else [], + options.ignore_headers.split('@@') if options.ignore_headers else []) if 'MESON_INSTALL_PREFIX' in os.environ: install_dir = options.install_dir if options.install_dir else options.modulename |