doxygen Doxyfile: Generate C/C++ API Docs
doxygen reads a Doxyfile configuration and extracts documentation from source comments into HTML, XML, or LaTeX.
Doxygen is the standard API doc generator for C and C++. It is config-driven: you run doxygen Doxyfile and it does the rest. In CI, WARN_AS_ERROR is what enforces documented code.
What it does
doxygen parses source files listed in the Doxyfile (via INPUT), extracts doc comments, and generates output in the enabled formats (GENERATE_HTML, GENERATE_XML, and so on). Running it with no argument uses a file literally named Doxyfile in the current directory.
Common usage
# generate a default config, then build
doxygen -g Doxyfile
doxygen Doxyfile
# pipe a config from stdin, overriding one setting
( cat Doxyfile ; echo "WARN_AS_ERROR=YES" ) | doxygen -Options
| Item | What it does |
|---|---|
| doxygen <Doxyfile> | Build docs using the given config file |
| doxygen -g <file> | Generate a template configuration file |
| doxygen - | Read the configuration from stdin |
| WARN_AS_ERROR | Config: YES or FAIL_ON_WARNINGS to fail on warnings |
| WARN_IF_UNDOCUMENTED | Config: warn about undocumented members |
| QUIET | Config: suppress normal progress output |
In CI
Set WARN_AS_ERROR = FAIL_ON_WARNINGS in the Doxyfile so doxygen still generates all output but exits non-zero if anything is undocumented, giving you the full warning list in one run. Cache nothing; doxygen is fast. Install graphviz on the runner if you enable HAVE_DOT diagrams.
Common errors in CI
warning: Compound X is not documented. and warning: parameter 'y' of member f() is not documented. are the classic undocumented-code warnings that WARN_AS_ERROR turns into failures. error: sh: dot: command not found means graphviz is missing while HAVE_DOT is YES. warning: source 'src' is not a readable file or directory means an INPUT path is wrong.