Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: add doc target #51

Merged
merged 2 commits into from
Oct 3, 2022
Merged

build: add doc target #51

merged 2 commits into from
Oct 3, 2022

Conversation

Tachi107
Copy link
Contributor

This patch adds a doc target generating Doxygen documentation; please see the individual commits for details :)

@Tachi107 Tachi107 force-pushed the build-doc branch 2 times, most recently from 2f77b8a to bd46fe5 Compare September 30, 2022 09:14
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
@flobernd
Copy link
Member

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 🙂

@Tachi107
Copy link
Contributor Author

Tachi107 commented Sep 30, 2022

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 :/

Tachi107 added a commit to Tachi107/zydis that referenced this pull request Oct 1, 2022
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.
Tachi107 added a commit to Tachi107/zydis that referenced this pull request Oct 2, 2022
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.
Tachi107 added a commit to Tachi107/zydis that referenced this pull request Oct 2, 2022
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.
athre0z pushed a commit to zyantific/zydis that referenced this pull request Oct 3, 2022
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.
@athre0z athre0z merged commit 8f39333 into zyantific:master Oct 3, 2022
@athre0z
Copy link
Member

athre0z commented Oct 3, 2022

Thanks!

@Tachi107 Tachi107 deleted the build-doc branch October 5, 2022 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants