gnome.gtkdoc: Add support for non string based content files
gnome's gtkdoc function does not support content files which are
not strings. However, there are situations where files generated
by other targets might be needed.
@@ -776,7 +776,28 @@ 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)
+
+ 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)):
+ 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):
+ for gen_src in s.get_outputs():
+ content_files.append(os.path.join(state.environment.get_source_dir(),
+ state.subdir,
+ gen_src))
+ else:
+ content_files.append(os.path.join(state.environment.get_source_dir(),
+ state.subdir,
+ s))
+ 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)
