aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesonbuild/modules/gnome.py4
-rwxr-xr-xmesonbuild/scripts/gtkdochelper.py8
2 files changed, 10 insertions, 2 deletions
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
index 4658e6d..7f63753 100644
--- a/mesonbuild/modules/gnome.py
+++ b/mesonbuild/modules/gnome.py
@@ -656,6 +656,8 @@ can not be used with the current version of glib-compiled-resources, due to
targetname = modulename + '-doc'
command = [state.environment.get_build_command(), '--internal', 'gtkdoc']
+ namespace = kwargs.get('namespace', '')
+
src_dirs = kwargs['src_dir']
if not isinstance(src_dirs, list):
src_dirs = [src_dirs]
@@ -677,6 +679,8 @@ can not be used with the current version of glib-compiled-resources, due to
'--headerdirs=' + '@@'.join(header_dirs),
'--mainfile=' + main_file,
'--modulename=' + modulename]
+ if namespace:
+ args.append('--namespace=' + namespace)
args += self._unpack_args('--htmlargs=', 'html_args', kwargs)
args += self._unpack_args('--scanargs=', 'scan_args', kwargs)
args += self._unpack_args('--scanobjsargs=', 'scanobjs_args', kwargs)
diff --git a/mesonbuild/scripts/gtkdochelper.py b/mesonbuild/scripts/gtkdochelper.py
index ec7678b..286d3ae 100755
--- a/mesonbuild/scripts/gtkdochelper.py
+++ b/mesonbuild/scripts/gtkdochelper.py
@@ -40,6 +40,7 @@ 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('--namespace', dest='namespace', default='')
parser.add_argument('--installdir', dest='install_dir')
def gtkdoc_run_check(cmd, cwd):
@@ -57,7 +58,7 @@ def gtkdoc_run_check(cmd, cwd):
def build_gtkdoc(source_root, build_root, doc_subdir, src_subdirs,
main_file, module, html_args, scan_args, fixxref_args,
gobject_typesfile, scanobjs_args, ld, cc, ldflags, cflags,
- html_assets, content_files, ignore_headers):
+ html_assets, content_files, ignore_headers, namespace):
print("Building documentation for %s" % module)
src_dir_args = ['--source-dir=' + os.path.join(source_root, src_dir) for src_dir in src_subdirs]
@@ -114,6 +115,8 @@ def build_gtkdoc(source_root, build_root, doc_subdir, src_subdirs,
'--output-format=xml',
'--expand-content-files=',
modeflag] + src_dir_args
+ if namespace:
+ mkdb_cmd.append('--name-space=' + namespace)
if len(main_file) > 0:
# Yes, this is the flag even if the file is in xml.
mkdb_cmd.append('--main-sgml-file=' + main_file)
@@ -179,7 +182,8 @@ def run(args):
options.cflags,
options.html_assets.split('@@') if options.html_assets else [],
options.content_files.split('@@') if options.content_files else [],
- options.ignore_headers.split('@@') if options.ignore_headers else [])
+ options.ignore_headers.split('@@') if options.ignore_headers else [],
+ options.namespace)
if 'MESON_INSTALL_PREFIX' in os.environ:
install_dir = options.install_dir if options.install_dir else options.modulename