Skip to content

Commit b550d74

Browse files
committed
[doc]: conditionally include ocaml_doc in ALL target based on LLVM_BUILD_DOCS
Make `ocaml_doc` an ALL target only when `LLVM_BUILD_DOCS` is enabled to avoid unnecessary build steps when documentation generation is not required.
1 parent eb1ecee commit b550d74

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

llvm/docs/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,12 @@ if( NOT uses_ocaml LESS 0 AND LLVM_ENABLE_OCAMLDOC )
136136
list(APPEND odoc_files -load ${odoc_file})
137137
endforeach()
138138

139-
add_custom_target(ocaml_doc ALL
139+
set(OCAML_DOC_ADD_TO_ALL "")
140+
if(LLVM_BUILD_DOCS)
141+
set(OCAML_DOC_ADD_TO_ALL ALL)
142+
endif()
143+
144+
add_custom_target(ocaml_doc ${OCAML_DOC_ADD_TO_ALL}
140145
COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_CURRENT_BINARY_DIR}/ocamldoc/html
141146
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/ocamldoc/html
142147
COMMAND ${OCAMLFIND} ocamldoc -d ${CMAKE_CURRENT_BINARY_DIR}/ocamldoc/html

0 commit comments

Comments
 (0)