meson: wrap html documentation generation with gtk_doc option

By default, if a host environment has the `rst2html5` application
available, builds will automatically perform some HTML documentation
generation from the documentation's glib reference content (e.g.
creating `gvariant-specification-1.0.html`). The creation of this
documentation is not required for all use cases.

This commit tweaks the building of the HTML-based GLIB specification
document to be guarded by `gtk_doc`.

Signed-off-by: James Knight <james.d.knight@live.com>
This commit is contained in:
James Knight 2023-04-27 20:23:30 -04:00
parent c176fcf2eb
commit 0fa17ec3c7

View File

@ -113,35 +113,37 @@ if get_option('man')
endforeach
endif
# GVariant specification is currently standalone
rst2html5 = find_program('rst2html5', 'rst2html5.py', required: false)
if get_option('gtk_doc')
# GVariant specification is currently standalone
rst2html5 = find_program('rst2html5', 'rst2html5.py', required: false)
if rst2html5.found()
spec_path = glib_datadir / 'doc' / 'glib-2.0'
if rst2html5.found()
spec_path = glib_datadir / 'doc' / 'glib-2.0'
figures = files(
'gvariant-byte-boundaries.svg',
'gvariant-integer-and-string-structure.svg',
'gvariant-integer-array.svg',
'gvariant-string-array.svg',
)
figures = files(
'gvariant-byte-boundaries.svg',
'gvariant-integer-and-string-structure.svg',
'gvariant-integer-array.svg',
'gvariant-string-array.svg',
)
custom_target('gvariant-specification-1.0',
input: 'gvariant-specification-1.0.rst',
output: 'gvariant-specification-1.0.html',
command: [
rst2html5,
'@INPUT@',
],
capture: true,
install: true,
install_dir: spec_path,
install_tag: 'doc',
depend_files: figures,
)
custom_target('gvariant-specification-1.0',
input: 'gvariant-specification-1.0.rst',
output: 'gvariant-specification-1.0.html',
command: [
rst2html5,
'@INPUT@',
],
capture: true,
install: true,
install_dir: spec_path,
install_tag: 'doc',
depend_files: figures,
)
install_data(figures,
install_dir : spec_path,
install_tag : 'doc',
)
endif
install_data(figures,
install_dir : spec_path,
install_tag : 'doc',
)
endif
endif