aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules/gnome.py
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2019-07-16 15:50:33 -0400
committerJussi Pakkanen <jpakkane@gmail.com>2019-07-16 22:50:33 +0300
commitf5da88112667fddb991ee455c051c9453b2542c1 (patch)
tree1afabfa522d6c8b9186107ec1d01f424ef47b60b /mesonbuild/modules/gnome.py
parent9bb6093fa08d665f49926eab3871923be40b5110 (diff)
downloadmeson-f5da88112667fddb991ee455c051c9453b2542c1.zip
meson-f5da88112667fddb991ee455c051c9453b2542c1.tar.gz
meson-f5da88112667fddb991ee455c051c9453b2542c1.tar.bz2
gtkdoc: Add 'check' kwarg (#5591)
* gtkdoc: Add 'check' kwarg This runs gtkdoc-check in meson tests. Also reorganize the gtkdoc test because we cannot reliably build multiple doc into the same directory. Not all files generated by gtk-doc are prefixed with the target name.
Diffstat (limited to 'mesonbuild/modules/gnome.py')
-rw-r--r--mesonbuild/modules/gnome.py21
1 files changed, 19 insertions, 2 deletions
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
index aa815c7..f67c7c2 100644
--- a/mesonbuild/modules/gnome.py
+++ b/mesonbuild/modules/gnome.py
@@ -913,6 +913,7 @@ This will become a hard error in the future.''')
rv = [inscript, pottarget, potarget]
return ModuleReturnValue(None, rv)
+ @FeatureNewKwargs('gnome.gtkdoc', '0.52.0', ['check'])
@FeatureNewKwargs('gnome.gtkdoc', '0.48.0', ['c_args'])
@FeatureNewKwargs('gnome.gtkdoc', '0.48.0', ['module_version'])
@FeatureNewKwargs('gnome.gtkdoc', '0.37.0', ['namespace', 'mode'])
@@ -1019,10 +1020,26 @@ This will become a hard error in the future.''')
args += self._unpack_args('--ignore-headers=', 'ignore_headers', kwargs)
args += self._unpack_args('--installdir=', 'install_dir', kwargs)
args += self._get_build_args(kwargs, state, depends)
- res = [build.RunTarget(targetname, command[0], command[1:] + args, depends, state.subdir, state.subproject)]
+ custom_kwargs = {'output': modulename + '-decl.txt',
+ 'command': command + args,
+ 'depends': depends,
+ 'build_always_stale': True,
+ }
+ custom_target = build.CustomTarget(targetname, state.subdir, state.subproject, custom_kwargs)
+ alias_target = build.AliasTarget(targetname, [custom_target], state.subdir, state.subproject)
+ if kwargs.get('check', False):
+ check_cmd = self.interpreter.find_program_impl('gtkdoc-check')
+ check_env = ['DOC_MODULE=' + modulename,
+ 'DOC_MAIN_SGML_FILE=' + main_file]
+ check_args = [targetname + '-check', check_cmd]
+ check_kwargs = {'env': check_env,
+ 'workdir': os.path.join(state.environment.get_build_dir(), state.subdir),
+ 'depends': custom_target}
+ self.interpreter.add_test(state.current_node, check_args, check_kwargs, True)
+ res = [custom_target, alias_target]
if kwargs.get('install', True):
res.append(build.RunScript(command, args))
- return ModuleReturnValue(None, res)
+ return ModuleReturnValue(custom_target, res)
def _get_build_args(self, kwargs, state, depends):
args = []