[v2,6/6] doc/api: make doc warnings errors when werror option set

Message ID 20200929165502.336919-7-bruce.richardson@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series improve building docs |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-testing success Testing PASS

Commit Message

Bruce Richardson Sept. 29, 2020, 4:55 p.m. UTC
  When the --werror meson build option is set, we can set the WARN_AS_ERRORS
doxygen option in the doxygen config flag to get the same behaviour for API
doc building as for building the rest of DPDK. This can help catch
documentation errors sooner in the development process.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 doc/api/doxy-api.conf.in | 1 +
 doc/api/meson.build      | 4 ++++
 2 files changed, 5 insertions(+)
  

Comments

Thomas Monjalon Sept. 29, 2020, 5:33 p.m. UTC | #1
--- a/doc/api/doxy-api.conf.in
+++ b/doc/api/doxy-api.conf.in
@@ -89,6 +89,7 @@ HIDE_SCOPE_NAMES        = YES
 GENERATE_DEPRECATEDLIST = YES
 VERBATIM_HEADERS        = NO
 ALPHABETICAL_INDEX      = NO
+WARN_AS_ERROR           = @WARN_AS_ERROR@

This section is about the appearance of the output.
I think this new "warning" option would better fit at the end of the file.
  

Patch

diff --git a/doc/api/doxy-api.conf.in b/doc/api/doxy-api.conf.in
index 42d38919d..9182ee852 100644
--- a/doc/api/doxy-api.conf.in
+++ b/doc/api/doxy-api.conf.in
@@ -89,6 +89,7 @@  HIDE_SCOPE_NAMES        = YES
 GENERATE_DEPRECATEDLIST = YES
 VERBATIM_HEADERS        = NO
 ALPHABETICAL_INDEX      = NO
+WARN_AS_ERROR           = @WARN_AS_ERROR@
 
 HTML_TIMESTAMP          = NO
 HTML_DYNAMIC_SECTIONS   = YES
diff --git a/doc/api/meson.build b/doc/api/meson.build
index e9b49f9c2..4f51f5d72 100644
--- a/doc/api/meson.build
+++ b/doc/api/meson.build
@@ -37,6 +37,10 @@  cdata.set('OUTPUT', join_paths(meson.build_root(), 'doc', 'api'))
 cdata.set('HTML_OUTPUT', 'html')
 cdata.set('TOPDIR', meson.source_root())
 cdata.set('STRIP_FROM_PATH', meson.source_root())
+cdata.set('WARN_AS_ERROR', 'NO')
+if get_option('werror')
+	cdata.set('WARN_AS_ERROR', 'YES')
+endif
 
 doxy_conf = configure_file(input: 'doxy-api.conf.in',
 	output: 'doxy-api.conf',