summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorBruce Richardson <bruce.richardson@intel.com>2018-09-20 14:22:08 +0100
committerThomas Monjalon <thomas@monjalon.net>2018-10-27 23:24:22 +0200
commitd02a2dab2dfb33969c74412e99720a9eaf1e703a (patch)
treef8d8d485ae87f58653bd0d1a68360e95a31c7589 /doc
parentb63e5d479019f6d1873beb66591be556fca0f11a (diff)
downloaddpdk-d02a2dab2dfb33969c74412e99720a9eaf1e703a.zip
dpdk-d02a2dab2dfb33969c74412e99720a9eaf1e703a.tar.gz
dpdk-d02a2dab2dfb33969c74412e99720a9eaf1e703a.tar.xz
doc: support building HTML guides with meson
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Signed-off-by: Luca Boccassi <bluca@debian.org> Tested-by: Timothy Redaelli <tredaelli@redhat.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/api/meson.build5
-rw-r--r--doc/guides/meson.build28
-rw-r--r--doc/meson.build11
3 files changed, 41 insertions, 3 deletions
diff --git a/doc/api/meson.build b/doc/api/meson.build
index 13fcbb8..30bdc57 100644
--- a/doc/api/meson.build
+++ b/doc/api/meson.build
@@ -50,7 +50,6 @@ if doxygen.found()
install_dir: htmldir,
build_by_default: false)
- run_target('doc', command: 'true', depends: doxy_build)
-else
- run_target('doc', command: ['echo', 'doxygen', 'not', 'found'])
+ doc_targets += doxy_build
+ doc_target_names += 'Doxygen_API'
endif
diff --git a/doc/guides/meson.build b/doc/guides/meson.build
new file mode 100644
index 0000000..06f1488
--- /dev/null
+++ b/doc/guides/meson.build
@@ -0,0 +1,28 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2018 Intel Corporation
+
+sphinx = find_program('sphinx-build', required: get_option('enable_docs'))
+
+if sphinx.found()
+ htmldir = join_paths('share', 'doc', 'dpdk')
+ html_guides_build = custom_target('html_guides_build',
+ input: meson.current_source_dir(),
+ output: 'guides',
+ command: [sphinx, '-b', 'html',
+ '-d', meson.current_build_dir() + '/.doctrees',
+ '@INPUT@', meson.current_build_dir() + '/guides'],
+ build_by_default: false,
+ install: get_option('enable_docs'),
+ install_dir: htmldir)
+
+ doc_targets += html_guides_build
+ doc_target_names += 'HTML_Guides'
+
+ # sphinx leaves a .buildinfo in the target directory, which we don't
+ # want to install. Note that sh -c has to be used, otherwise the
+ # env var does not get expanded if calling rm/install directly.
+ meson.add_install_script('sh', '-c',
+ 'rm -f $MESON_INSTALL_DESTDIR_PREFIX/share/doc/dpdk/guides/.buildinfo')
+ meson.add_install_script('sh', '-c',
+ 'install -D -m0644 $MESON_SOURCE_ROOT/doc/guides/custom.css $MESON_INSTALL_DESTDIR_PREFIX/share/doc/dpdk/guides/_static/css/custom.css')
+endif
diff --git a/doc/meson.build b/doc/meson.build
index afca2e7..c5410d8 100644
--- a/doc/meson.build
+++ b/doc/meson.build
@@ -1,4 +1,15 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2018 Luca Boccassi <bluca@debian.org>
+doc_targets = []
+doc_target_names = []
subdir('api')
+subdir('guides')
+
+if doc_targets.length() == 0
+ message = 'No docs targets found'
+else
+ message = 'Building docs:'
+endif
+run_target('doc', command: ['echo', message, doc_target_names],
+ depends: doc_targets)