build: add doc target#51
Conversation
2f77b8a to
bd46fe5
Compare
This new target, only available if Doxygen is found on the build machine, generates Doxygen documentation with CMake's doxygen_add_docs()
This allows building Zycore when only a C compiler is installed
|
Thanks a lot for the PR! We see one minor problem regarding consistency (CMake generated vs. workflow generated will e.g. use different Doxygen styles and index pages), but unifying it will probably a lot of work as we have to adjust our custom tooling that is used in the pipelines. I let @athre0z decide if we should merge it now or if we want to improve it first. I'm personally fine with either way. Involving CMake in the documentation generation is a nice improvement anyways 🙂 |
|
Using CMake has a few advantages, as I described in mozilla/cubeb#726. It also makes things easier for me, as I'd like to ship Doxygen-generated documentation in the Zycore and Zydis Debian packages; in fact, I'm preparing a similar patch for Zydis as well. I would've updated the pipeline too, but I couldn't find it in the repo :/ |
This patch adds a doc target generating Doxygen documentation similarly to <zyantific/zycore-c#51>, but with some extra bits: if doxygen-awesome.css is found on the host system, CMake will automatically use it to generate themed documentation. Using `doxygen_add_docs()` requires setting the various Doxygen options in CMakeLists.txt, so there's currently a bit of duplication as the same options are also contained in Doxyfile and Doxyfile-themed. I couldn't remove the two standalone files as they are still required by the doc.yml CI/CD pipeline, as `zydoc` runs Doxygen itself; as a solution, `zydoc` could add support for a `--doxygen-generated <path>` flag that tells it to use already generated Doxygen documentation instead of generating its own.
This patch adds a doc target generating Doxygen documentation similarly to <zyantific/zycore-c#51>, but with some extra bits: if doxygen-awesome.css is found on the host system, CMake will automatically use it to generate themed documentation. Using `doxygen_add_docs()` requires setting the various Doxygen options in CMakeLists.txt, so to avoid duplicating things in different places I wrote a bit of CMake code that parses the Doxyfile and sets the various options as CMake variables prefixed by DOXYGEN_. The "parser" is really basic, and does not handle values that span over multiple lines.
This patch adds a doc target generating Doxygen documentation similarly to <zyantific/zycore-c#51>, but with some extra bits: if doxygen-awesome.css is found on the host system, CMake will automatically use it to generate themed documentation. Using `doxygen_add_docs()` requires setting the various Doxygen options in CMakeLists.txt, so to avoid duplicating things in different places I wrote a bit of CMake code that parses the Doxyfile and sets the various options as CMake variables prefixed by DOXYGEN_. The "parser" is really basic, and does not handle values that span over multiple lines.
This patch adds a doc target generating Doxygen documentation similarly to <zyantific/zycore-c#51>, but with some extra bits: if doxygen-awesome.css is found on the host system, CMake will automatically use it to generate themed documentation. Using `doxygen_add_docs()` requires setting the various Doxygen options in CMakeLists.txt, so to avoid duplicating things in different places I wrote a bit of CMake code that parses the Doxyfile and sets the various options as CMake variables prefixed by DOXYGEN_. The "parser" is really basic, and does not handle values that span over multiple lines.
|
Thanks! |
This patch adds a doc target generating Doxygen documentation; please see the individual commits for details :)