diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2018-09-23 16:30:18 +0200 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2018-09-28 17:25:46 +0200 |
commit | b4ba9f56fffe972631b1e45e20bff9404f941c5a (patch) | |
tree | c44ae0ffec22d6b62986c3fe5aec39f5d4e0bf2b | |
parent | 12979b79f92738c6b6d885d894acc9045e738907 (diff) |
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).
-rw-r--r-- | docs/api/meson.build | 17 | ||||
-rw-r--r-- | introspection/meson.build | 12 | ||||
-rw-r--r-- | man/meson.build | 2 | ||||
-rw-r--r-- | meson.build | 1 |
4 files changed, 28 insertions, 4 deletions
diff --git a/docs/api/meson.build b/docs/api/meson.build index d0cc3ac8c..31b9776c8 100644 --- a/docs/api/meson.build +++ b/docs/api/meson.build @@ -21,6 +21,23 @@ configure_file( ) 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( doc_module, diff --git a/introspection/meson.build b/introspection/meson.build index a55408368..35d8c87c4 100644 --- a/introspection/meson.build +++ b/introspection/meson.build @@ -53,6 +53,7 @@ ifaces = [ ifaces_xmls = [] sources = [] +introspection_files = [] # FIXME?: DBUS_INTERFACE_DOCS/docbook files are generated in # "meson.current_build_dir()" instead of "meson.source_root()/docs/api" @@ -60,7 +61,7 @@ foreach iface: ifaces iface_xml = iface + '.xml' ifaces_xmls += files(iface_xml) - sources += gnome.gdbus_codegen( + res = gnome.gdbus_codegen( iface, iface_xml, interface_prefix: 'org.freedesktop.NetworkManager', @@ -68,8 +69,15 @@ foreach iface: ifaces 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) + + # 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 install_data( diff --git a/man/meson.build b/man/meson.build index 63348054c..21fac21d1 100644 --- a/man/meson.build +++ b/man/meson.build @@ -48,8 +48,6 @@ if enable_ovs mans += [['nm-openvswitch', '7']] endif -content_files += join_paths(meson.current_build_dir(), 'common.ent') - foreach man: mans input = man[0] + '.xml' content_files += join_paths(meson.current_source_dir(), input) diff --git a/meson.build b/meson.build index 4dab561d0..278f5a2c3 100644 --- a/meson.build +++ b/meson.build @@ -879,6 +879,7 @@ enable_docs = get_option('docs') if enable_docs assert(enable_introspection, '-Ddocs=true requires -Dintrospection=true') + assert(meson.version().version_compare('>= 0.46.0'), '-Ddocs requires meson >= 0.46') subdir('man') subdir('docs') endif |