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>
This commit is contained in:
Laurent Pinchart 2023-05-06 13:22:15 +03:00
parent c49958d0b4
commit 1d5a072c5e
3 changed files with 10 additions and 2 deletions

View file

@ -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)