From ee173abeb31bbe6d853501223fc28b657e954906 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Cab=C3=A9?= Date: Wed, 9 Jul 2025 17:58:33 +0200 Subject: [PATCH] doc: doxygen: use STRIP_FROM_INC_PATH to keep #includes clean MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Another take on zephyrproject-rtos/zephyr#76953. This uses STRIP_FROM_INC_PATH to make sure #include snippets in the documentation are not absolute paths and reflect what one would actually use in their code. Signed-off-by: Benjamin Cabé --- doc/zephyr.doxyfile.in | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/doc/zephyr.doxyfile.in b/doc/zephyr.doxyfile.in index 2e3e97914ce..14081ac36b9 100644 --- a/doc/zephyr.doxyfile.in +++ b/doc/zephyr.doxyfile.in @@ -189,7 +189,17 @@ STRIP_FROM_PATH = @ZEPHYR_BASE@/include # specify the list of include paths that are normally passed to the compiler # using the -I flag. -STRIP_FROM_INC_PATH = +# TODO: Once https://github.com/doxygen/doxygen/pull/11657 is accepted and +# available in a released Doxygen version, the entry +# "@ZEPHYR_BASE@/lib/libc/minimal/include/" should be added to this list. +# In the meantime, API from headers contained in this folder (e.g. errno.h) will +# continue to show incorrect include path in the generated docs. + +STRIP_FROM_INC_PATH = @ZEPHYR_BASE@/include/ \ + @ZEPHYR_BASE@/kernel/include/ \ + @ZEPHYR_BASE@/subsys/testsuite/include/ \ + @ZEPHYR_BASE@/subsys/secure_storage/include/internal \ + @ZEPHYR_BASE@/subsys/secure_storage/include # If the SHORT_NAMES tag is set to YES, Doxygen will generate much shorter (but # less readable) file names. This can be useful is your file systems doesn't @@ -996,6 +1006,10 @@ WARN_LOGFILE = # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. +# Note that when adding paths to INPUT you most likely want to add them +# to STRIP_FROM_INC_PATH as well, which will remove those parts from +# the paths of the #include examples in the generated documentation. + INPUT = @ZEPHYR_BASE@/doc/_doxygen/mainpage.md \ @ZEPHYR_BASE@/doc/_doxygen/groups.dox \ @ZEPHYR_BASE@/kernel/include/kernel_arch_interface.h \