This patch fixes the man page build. It currently doesn't work as
SOURCE_DIR isn't set correctly (just undefined) within the
add_sphinx_target function. This patch also moves around the creation of
targets for autogenerated rst files so that both the man page and html
build can depend upon them as before only the html build depended on
them.
Details
- Reviewers
aaron.ballman tstellar rnk - Commits
- rGdb63fb5d45e0: [Clang][Docs] Fix man page build
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Posting this as when I was setting up a new dev environment with -DLLVM_ENABLE_SPHINX, it defaults to having SPHINX_OUTPUT_HTML and SPHINX_OUTPUT_MAN on, and the man build was broken so when I tried to build the default target, it failed. This patch fixes the clang man page build.
Not sure this is the ideal approach. I'd really like to remove the redundancy between the generated targets reference in gen_docs_depends and their values as specified in the calls to gen_rst_files_from_td, but CMake doesn't really seem to have appropriate data structures (a list of tuples or something similar) to accomplish this. Very open to suggestions here though since I'm not that familiar with CMake.
I think we could remove some of the duplication by making the docs_target parameter into a list and passing both docs-clang-html and docs-clang-man to it.
If I'm understanding things correctly we wouldn't be able to do this for either the gen_docs_depends or gen_rst_file_from_td functions because someone might have the HTML docs build turned on and the man pages build turned off or vice versa. We can only add dependencies to the target after it's created as far as I'm aware.
Thank you very much for your patience and writing everything out. That makes a lot more sense. The resulting code definitely has a lot more desirable properties. I've updated the diff in accordance with your suggestions.