diff options
Diffstat (limited to 'modules/gnome.py')
-rw-r--r-- | modules/gnome.py | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/modules/gnome.py b/modules/gnome.py index 7a0ef4b..43c0537 100644 --- a/modules/gnome.py +++ b/modules/gnome.py @@ -16,7 +16,7 @@ functionality such as gobject-introspection and gresources.''' import build -import os +import os, sys import subprocess from coredata import MesonException import mlog @@ -176,6 +176,31 @@ class GnomeModule: target_g = build.CustomTarget(targetname, state.subdir, kwargs) return target_g + def gtkdoc(self, state, args, kwargs): + if len(args) != 1: + raise MesonException('Gtkdoc must have one positional argument.') + modulename = args[0] + if not isinstance(modulename, str): + raise MesonException('Gtkdoc arg must be string.') + if not 'src_dir' in kwargs: + raise MesonException('Keyword argument src_dir missing.') + main_sgml = kwargs.get('main_sgml', '') + if not isinstance(main_sgml, str): + raise MesonException('Main sgml keyword argument must be a string.') + src_dir = kwargs['src_dir'] + targetname = modulename + '-doc' + command = os.path.normpath(os.path.join(os.path.split(__file__)[0], "../gtkdochelper.py")) + args = [state.environment.get_source_dir(), + state.environment.get_build_dir(), + state.subdir, + os.path.normpath(os.path.join(state.subdir, src_dir)), + main_sgml, + modulename] + res = [build.RunTarget(targetname, command, args, state.subdir)] + if kwargs.get('install', True): + res.append(build.InstallScript([command] + args)) + return res + def gdbus_codegen(self, state, args, kwargs): if len(args) != 2: raise MesonException('Gdbus_codegen takes two arguments, name and xml file.') |