summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2023-05-06 13:22:15 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2023-07-05 15:38:55 +0300
commit1d5a072c5e9efd04fd081e6215fa800690058575 (patch)
tree0d9a8bf20125ec7564aa3f30401e245349646eab
parentc49958d0b456619c32a04d074f592cc1665a24b5 (diff)
Documentation: Add predefined macros from config.h to Doxyfile
libcamera creates a config.h file with predefined macros, and instructs the compiler to include it implicitly with the -include argument. Doxygen has no support for implicit inclusion of headers, but has a PREDEFINED configuration option for its preprocessor that lists predefined macros. Populate it with the values from the config_h configuration data object that is used for generate the config.h file, to ensure that documentation matches the configuration options libcamera has been built with. Bump the minimum meson version to 0.57 to use cfg_data.keys(). Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
-rw-r--r--Documentation/Doxyfile.in3
-rw-r--r--Documentation/meson.build7
-rw-r--r--meson.build2
3 files changed, 10 insertions, 2 deletions
diff --git a/Documentation/Doxyfile.in b/Documentation/Doxyfile.in
index 1447abdb..697a14d1 100644
--- a/Documentation/Doxyfile.in
+++ b/Documentation/Doxyfile.in
@@ -80,6 +80,7 @@ INCLUDE_FILE_PATTERNS = *.h
PREDEFINED = __DOXYGEN__ \
__cplusplus \
- __attribute__(x)=
+ __attribute__(x)= \
+ @PREDEFINED@
HAVE_DOT = YES
diff --git a/Documentation/meson.build b/Documentation/meson.build
index 18646156..d675f368 100644
--- a/Documentation/meson.build
+++ b/Documentation/meson.build
@@ -16,6 +16,13 @@ if doxygen.found() and dot.found()
cdata.set('TOP_BUILDDIR', meson.project_build_root())
cdata.set('OUTPUT_DIR', meson.current_build_dir())
+ doxygen_predefined = []
+ foreach key : config_h.keys()
+ doxygen_predefined += '@0@=@1@'.format(key, config_h.get(key))
+ endforeach
+
+ cdata.set('PREDEFINED', ' \\\n\t\t\t '.join(doxygen_predefined))
+
doxyfile = configure_file(input : 'Doxyfile.in',
output : 'Doxyfile',
configuration : cdata)
diff --git a/meson.build b/meson.build
index 9c1e7081..62db8ed8 100644
--- a/meson.build
+++ b/meson.build
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: CC0-1.0
project('libcamera', 'c', 'cpp',
- meson_version : '>= 0.56',
+ meson_version : '>= 0.57',
version : '0.0.5',
default_options : [
'werror=true',