[flang-commits] [flang] [Flang] Add Sphinx man page and html support for Flang (PR #141882)
Samarth Narang via flang-commits
flang-commits at lists.llvm.org
Wed Jun 4 10:45:55 PDT 2025
snarang181 wrote:
> > > I'm trying to build it, but it fails, I presume due to warnings being treated as errors as I can't see any actual errors in the log. Does it build for you?:
> > > ```
> > >
> > > WARNING: multiple files found for the document "index": index.md, index.rst
> > > ```
> >
> >
> > Are you building man or HTML?
>
> This is a simple change I've added to the build script (I presume this is how it will be used by the others too):
>
> ```
> -DLLVM_BUILD_DOCS=ON
> -DLLVM_ENABLE_SPHINX=ON
> ```
>
> This results in the following lines being generated in the `CMakeCache.txt` file:
>
> ```
> //Generate build targets for the Flang docs.
> FLANG_INCLUDE_DOCS:BOOL=ON
>
> //HTML documentation install directory for flang
> FLANG_INSTALL_SPHINX_HTML_DIR:STRING=share/doc/LLVM/flang/html
>
> //Output standalone HTML files
> SPHINX_OUTPUT_HTML:BOOL=ON
>
> //Output man pages
> SPHINX_OUTPUT_MAN:BOOL=ON
>
> //When building documentation treat warnings as errors
> SPHINX_WARNINGS_AS_ERRORS:BOOL=ON
> ```
>
> From this you can read I'm building both.
@pawosm-arm
**What was going on:** When we did a `ninja docs-flang-man` followed by `ninja docs-flang-html`, there were two refs to an `index` file -- one with a `.md` and another with an `.rst`. This was mainly because we had the same `CMAKE_BINARY_DIR/Source` dir. So I have separated the `Source` directories for both the builds to have independent workflows (this can be removed of course once we unify the index file).
https://github.com/llvm/llvm-project/pull/141882
More information about the flang-commits
mailing list