Commit dcfddeef authored by Beniamino Galvani's avatar Beniamino Galvani

build: meson: fix generation of api docs

We need to copy all introspection files to the same directory when
building the documentation.

Note that we only require Meson 0.44, but for the documentation at
least 0.46 is needed because of a new functionality of
gnome.gdbus_codegen(). In this way we can still build on Travis CI
(without documentation).
parent 92929833
...@@ -21,6 +21,23 @@ configure_file( ...@@ -21,6 +21,23 @@ configure_file(
) )
content_files += join_paths(meson.source_root(), 'COPYING') content_files += join_paths(meson.source_root(), 'COPYING')
filecopier = find_program('cp')
foreach intro : introspection_files
path = intro.full_path().split('/')[-1]
custom_target(path,
input: intro,
output: path,
command : [filecopier, '@INPUT@', '@OUTPUT@'],
build_by_default: true,
)
endforeach
custom_target('common.ent',
input: common_ent_file,
output: 'common.ent',
command: [filecopier, '@INPUT@', '@OUTPUT@'],
build_by_default: true,
)
gnome.gtkdoc( gnome.gtkdoc(
doc_module, doc_module,
......
...@@ -53,6 +53,7 @@ ifaces = [ ...@@ -53,6 +53,7 @@ ifaces = [
ifaces_xmls = [] ifaces_xmls = []
sources = [] sources = []
introspection_files = []
# FIXME?: DBUS_INTERFACE_DOCS/docbook files are generated in # FIXME?: DBUS_INTERFACE_DOCS/docbook files are generated in
# "meson.current_build_dir()" instead of "meson.source_root()/docs/api" # "meson.current_build_dir()" instead of "meson.source_root()/docs/api"
...@@ -60,7 +61,7 @@ foreach iface: ifaces ...@@ -60,7 +61,7 @@ foreach iface: ifaces
iface_xml = iface + '.xml' iface_xml = iface + '.xml'
ifaces_xmls += files(iface_xml) ifaces_xmls += files(iface_xml)
sources += gnome.gdbus_codegen( res = gnome.gdbus_codegen(
iface, iface,
iface_xml, iface_xml,
interface_prefix: 'org.freedesktop.NetworkManager', interface_prefix: 'org.freedesktop.NetworkManager',
...@@ -68,8 +69,15 @@ foreach iface: ifaces ...@@ -68,8 +69,15 @@ foreach iface: ifaces
docbook: 'dbus' docbook: 'dbus'
) )
# FIXME: gnome.gdbus_codegen should return the docbook as a target result sources += res
content_files += join_paths(meson.current_build_dir(), 'dbus-' + iface_xml) content_files += join_paths(meson.current_build_dir(), 'dbus-' + iface_xml)
# res is an array only since 0.46. Documentation won't work with
# older versions
if meson.version().version_compare('>= 0.46.0')
introspection_files += res[2]
endif
endforeach endforeach
install_data( install_data(
......
...@@ -48,8 +48,6 @@ if enable_ovs ...@@ -48,8 +48,6 @@ if enable_ovs
mans += [['nm-openvswitch', '7']] mans += [['nm-openvswitch', '7']]
endif endif
content_files += join_paths(meson.current_build_dir(), 'common.ent')
foreach man: mans foreach man: mans
input = man[0] + '.xml' input = man[0] + '.xml'
content_files += join_paths(meson.current_source_dir(), input) content_files += join_paths(meson.current_source_dir(), input)
......
...@@ -879,6 +879,7 @@ enable_docs = get_option('docs') ...@@ -879,6 +879,7 @@ enable_docs = get_option('docs')
if enable_docs if enable_docs
assert(enable_introspection, '-Ddocs=true requires -Dintrospection=true') assert(enable_introspection, '-Ddocs=true requires -Dintrospection=true')
assert(meson.version().version_compare('>= 0.46.0'), '-Ddocs requires meson >= 0.46')
subdir('man') subdir('man')
subdir('docs') subdir('docs')
endif endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment