Skip to content

Commit b8b752d

Browse files
authored
[flang][NFC] Create required Source dir for flang-doc. (#134000)
1 parent 3f6ae3f commit b8b752d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

flang/docs/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,15 @@ function (gen_rst_file_from_td output_file td_option source docs_target)
100100
list(APPEND LLVM_TABLEGEN_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR}/../../clang/include/clang/Driver/")
101101
clang_tablegen(Source/${output_file} ${td_option} SOURCE ${source} TARGET "gen-${output_file}")
102102
add_dependencies(${docs_target} "gen-${output_file}")
103+
104+
# clang_tablegen() does not create the output directory automatically,
105+
# so we have to create it explicitly. Note that copy-flang-src-docs below
106+
# does create the output directory, but it is not necessarily run
107+
# before RST generation.
108+
add_custom_target(create-flang-rst-output-dir
109+
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/Source
110+
)
111+
add_dependencies("gen-${output_file}" create-flang-rst-output-dir)
103112
endfunction()
104113

105114
if (LLVM_ENABLE_SPHINX)

0 commit comments

Comments
 (0)