Fix Clang Sphinx docs build

The CodeOwners.rst file needs to live in the same directory as the rest
of the documentation. This copies the file to the correct place when
making a Sphinx build but continues to leave the .rst file at the root
directory where it's easier for developers to find. This also ensures
that local doc builds using `make html` work as expected.
This commit is contained in:
Aaron Ballman 2022-09-06 09:50:47 -04:00
parent 0431eb59df
commit e1ebe476e4
1 changed files with 6 additions and 2 deletions

View File

@ -114,8 +114,12 @@ if (LLVM_ENABLE_SPHINX)
# directory before we run sphinx.
add_custom_target(copy-clang-rst-docs
COMMAND "${CMAKE_COMMAND}" -E copy_directory
"${CMAKE_CURRENT_SOURCE_DIR}"
"${CMAKE_CURRENT_BINARY_DIR}")
"${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}"
COMMAND "${CMAKE_COMMAND}" -E copy_if_different
"${CMAKE_CURRENT_SOURCE_DIR}/../CodeOwners.rst"
"${CMAKE_CURRENT_BINARY_DIR}"
)
add_dependencies(docs-clang-html copy-clang-rst-docs)
add_custom_command(TARGET docs-clang-html POST_BUILD