diff options
Diffstat (limited to 'mesonbuild/modules/gnome.py')
-rw-r--r-- | mesonbuild/modules/gnome.py | 41 |
1 files changed, 28 insertions, 13 deletions
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py index 241a531..e32037a 100644 --- a/mesonbuild/modules/gnome.py +++ b/mesonbuild/modules/gnome.py @@ -653,25 +653,39 @@ can not be used with the current version of glib-compiled-resources, due to if main_file != '': raise MesonException('You can only specify main_xml or main_sgml, not both.') main_file = main_xml - src_dir = kwargs['src_dir'] targetname = modulename + '-doc' command = [state.environment.get_build_command(), '--internal', 'gtkdoc'] - if hasattr(src_dir, 'held_object'): - src_dir= src_dir.held_object - if not isinstance(src_dir, build.IncludeDirs): - raise MesonException('Invalid keyword argument for src_dir.') - incdirs = src_dir.get_incdirs() - if len(incdirs) != 1: - raise MesonException('Argument src_dir has more than one directory specified.') - header_dir = os.path.join(state.environment.get_source_dir(), src_dir.get_curdir(), incdirs[0]) - else: - header_dir = os.path.normpath(os.path.join(state.subdir, src_dir)) + + namespace = kwargs.get('namespace', '') + mode = kwargs.get('mode', 'auto') + VALID_MODES = ('xml', 'sgml', 'none', 'auto') + if not mode in VALID_MODES: + raise MesonException('gtkdoc: Mode {} is not a valid mode: {}'.format(mode, VALID_MODES)) + + src_dirs = kwargs['src_dir'] + if not isinstance(src_dirs, list): + src_dirs = [src_dirs] + header_dirs = [] + for src_dir in src_dirs: + if hasattr(src_dir, 'held_object'): + src_dir = src_dir.held_object + if not isinstance(src_dir, build.IncludeDirs): + raise MesonException('Invalid keyword argument for src_dir.') + for inc_dir in src_dir.get_incdirs(): + header_dirs.append(os.path.join(state.environment.get_source_dir(), + src_dir.get_curdir(), inc_dir)) + else: + header_dirs.append(os.path.normpath(os.path.join(state.subdir, src_dir))) + args = ['--sourcedir=' + state.environment.get_source_dir(), '--builddir=' + state.environment.get_build_dir(), '--subdir=' + state.subdir, - '--headerdir=' + header_dir, + '--headerdirs=' + '@@'.join(header_dirs), '--mainfile=' + main_file, - '--modulename=' + modulename] + '--modulename=' + modulename, + '--mode=' + mode] + 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) @@ -679,6 +693,7 @@ can not be used with the current version of glib-compiled-resources, due to 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('--expand-content-files=', 'expand_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) |