aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules/gnome.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2017-12-26 13:15:08 +0200
committerGitHub <noreply@github.com>2017-12-26 13:15:08 +0200
commit1904b1a976d9d389f05ed5aa9b63de6f52c1c5e5 (patch)
tree5bcce9cd234788acb9254474c6bd595d86040c71 /mesonbuild/modules/gnome.py
parent7ed92d28e8ff38631b410949cd8a76b035dfa994 (diff)
parent7f78b8aafcc7469fc3876653ef8d7895762d59b8 (diff)
downloadmeson-1904b1a976d9d389f05ed5aa9b63de6f52c1c5e5.zip
meson-1904b1a976d9d389f05ed5aa9b63de6f52c1c5e5.tar.gz
meson-1904b1a976d9d389f05ed5aa9b63de6f52c1c5e5.tar.bz2
Merge pull request #2806 from inigomartinez/gtkdoc
gnome.gtkdoc: Add support for non string based content files
Diffstat (limited to 'mesonbuild/modules/gnome.py')
-rw-r--r--mesonbuild/modules/gnome.py31
1 files changed, 29 insertions, 2 deletions
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
index 7a01abc..ad99c14 100644
--- a/mesonbuild/modules/gnome.py
+++ b/mesonbuild/modules/gnome.py
@@ -776,12 +776,39 @@ This will become a hard error in the future.''')
args += self._unpack_args('--fixxrefargs=', 'fixxref_args', kwargs)
args += self._unpack_args('--mkdbargs=', 'mkdb_args', kwargs)
args += self._unpack_args('--html-assets=', 'html_assets', kwargs, state)
- args += self._unpack_args('--content-files=', 'content_files', kwargs, state)
+
+ depends = []
+ content_files = []
+ for s in mesonlib.extract_as_list(kwargs, 'content_files'):
+ if hasattr(s, 'held_object'):
+ s = s.held_object
+ if isinstance(s, (build.CustomTarget, build.CustomTargetIndex)):
+ depends.append(s)
+ content_files.append(os.path.join(state.environment.get_build_dir(),
+ state.backend.get_target_dir(s),
+ s.get_outputs()[0]))
+ elif isinstance(s, mesonlib.File):
+ content_files.append(s.rel_to_builddir(state.build_to_src))
+ elif isinstance(s, build.GeneratedList):
+ depends.append(s)
+ for gen_src in s.get_outputs():
+ content_files.append(os.path.join(state.environment.get_source_dir(),
+ state.subdir,
+ gen_src))
+ elif isinstance(s, str):
+ content_files.append(os.path.join(state.environment.get_source_dir(),
+ state.subdir,
+ s))
+ else:
+ raise MesonException(
+ 'Invalid object type: {!r}'.format(s.__class__.__name__))
+ args += ['--content-files=' + '@@'.join(content_files)]
+
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)
- res = [build.RunTarget(targetname, command[0], command[1:] + args, [], state.subdir, state.subproject)]
+ res = [build.RunTarget(targetname, command[0], command[1:] + args, depends, state.subdir, state.subproject)]
if kwargs.get('install', True):
res.append(build.RunScript(command, args))
return ModuleReturnValue(None, res)