numam-dpdk/doc/guides/meson.build
Bruce Richardson 87c95f0445 doc: fix build with latest meson
The latest versions of meson don't build targets when build_by_default is
false but install is true, unlike older versions. We can fix this by having
both build_by_default and install settings come from the build-time option.

Bugzilla ID: 303
Fixes: d02a2dab2d ("doc: support building HTML guides with meson")
Fixes: 720b14db3a ("build: generate API documentation with meson")
Cc: stable@dpdk.org

Reported-by: Ali Alnubani <alialnu@mellanox.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2019-07-06 10:32:40 +02:00

29 lines
1.1 KiB
Meson

# 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: get_option('enable_docs'),
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