summary refs log tree commit diff stats
path: root/docs/meson.build
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2023-03-14 11:44:31 +0000
committerLaurent Vivier <laurent@vivier.eu>2023-03-16 14:39:10 +0100
commit364206640c6b34bae3bb9e428817e51d23a794d0 (patch)
tree0c8084427cf1b25f76fc625920f2cd1866fb5bd8 /docs/meson.build
parentad4052f104ab2a6e78f13e1d3053508e00599de3 (diff)
downloadfocaccia-qemu-364206640c6b34bae3bb9e428817e51d23a794d0.tar.gz
focaccia-qemu-364206640c6b34bae3bb9e428817e51d23a794d0.zip
docs/sphinx/kerneldoc.py: Honour --enable-werror
Currently, the kerneldoc Sphinx plugin doesn't honour the
--enable-werror configure option, so its warnings are never fatal.
This is because although we do pass sphinx-build the -W switch, the
warnings from kerneldoc are produced by the scripts/kernel-doc script
directly and don't go through Sphinx's "emit a warning" function.

When --enable-werror is in effect, pass sphinx-build an extra
argument -Dkerneldoc_werror=1.  The kerneldoc plugin can then use
this to determine whether it should be passing the kernel-doc script
-Werror.

We do this because there is no documented mechanism for
a Sphinx plugin to determine whether sphinx-build was
passed -W or not; if one is provided then we can switch to
that at a later date:
https://github.com/sphinx-doc/sphinx/issues/11239

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20230314114431.1096972-1-peter.maydell@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'docs/meson.build')
-rw-r--r--docs/meson.build2
1 files changed, 1 insertions, 1 deletions
diff --git a/docs/meson.build b/docs/meson.build
index bb72c10ea8..f220800e3e 100644
--- a/docs/meson.build
+++ b/docs/meson.build
@@ -7,7 +7,7 @@ if sphinx_build.found()
   SPHINX_ARGS = ['env', 'CONFDIR=' + qemu_confdir, sphinx_build, '-q']
   # If we're making warnings fatal, apply this to Sphinx runs as well
   if get_option('werror')
-    SPHINX_ARGS += [ '-W' ]
+    SPHINX_ARGS += [ '-W', '-Dkerneldoc_werror=1' ]
   endif
 
   # This is a bit awkward but works: create a trivial document and