[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/5] docs: Pass disabled configure options to sphinx
From: |
Kevin Wolf |
Subject: |
[PATCH 1/5] docs: Pass disabled configure options to sphinx |
Date: |
Mon, 31 Jan 2022 18:04:07 +0100 |
Man pages and other documentation should only contain things that are
actually available in this build. In order to conditionally build
documentation depending on the build configuration, pass the
configuration to sphinx as tags.
The tags are negative so that building documentation from outside of
meson (in particular for things like readthedocs) without any tags set
results in the full documentation rather than disabling everything that
is optional.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
docs/meson.build | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/docs/meson.build b/docs/meson.build
index 57b28a3146..3220da4c15 100644
--- a/docs/meson.build
+++ b/docs/meson.build
@@ -37,6 +37,16 @@ endif
if build_docs
SPHINX_ARGS += ['-Dversion=' + meson.project_version(), '-Drelease=' +
config_host['PKGVERSION']]
+ foreach key: config_host_data.keys()
+ if not key.startswith('CONFIG_')
+ continue
+ endif
+ if '@0@'.format(config_host_data.get(key)) in ['0', 'false']
+ tag = 'DISABLE_' + key.substring(7)
+ SPHINX_ARGS += ['-t', tag]
+ endif
+ endforeach
+
have_ga = have_tools and config_host.has_key('CONFIG_GUEST_AGENT')
man_pages = {
--
2.31.1