diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake index de8e9bf9a494..0331d0fa10ab 100755 --- a/llvm/cmake/config-ix.cmake +++ b/llvm/cmake/config-ix.cmake @@ -530,6 +530,16 @@ else() message(STATUS "Doxygen disabled.") endif() +if (LLVM_ENABLE_SPHINX) + message(STATUS "Sphinx enabled.") + find_package(Sphinx REQUIRED) + if (LLVM_BUILD_DOCS) + add_custom_target(sphinx ALL) + endif() +else() + message(STATUS "Sphinx disabled.") +endif() + set(LLVM_BINDINGS "") if(WIN32) message(STATUS "Go bindings disabled.") diff --git a/llvm/cmake/modules/AddSphinxTarget.cmake b/llvm/cmake/modules/AddSphinxTarget.cmake index c3a676d3063d..cfc7f38e9e77 100644 --- a/llvm/cmake/modules/AddSphinxTarget.cmake +++ b/llvm/cmake/modules/AddSphinxTarget.cmake @@ -1,16 +1,3 @@ - -# Create sphinx target -if (LLVM_ENABLE_SPHINX AND NOT TARGET sphinx) - message(STATUS "Sphinx enabled.") - find_package(Sphinx REQUIRED) - if (LLVM_BUILD_DOCS) - add_custom_target(sphinx ALL) - endif() -else() - message(STATUS "Sphinx disabled.") -endif() - - # Handy function for creating the different Sphinx targets. # # ``builder`` should be one of the supported builders used by diff --git a/llvm/docs/CMakeLists.txt b/llvm/docs/CMakeLists.txt index 4437610146c4..6dff219ae37f 100644 --- a/llvm/docs/CMakeLists.txt +++ b/llvm/docs/CMakeLists.txt @@ -103,8 +103,8 @@ endif() endif() if (LLVM_ENABLE_SPHINX) - include(AddSphinxTarget) if (SPHINX_FOUND) + include(AddSphinxTarget) if (${SPHINX_OUTPUT_HTML}) add_sphinx_target(html llvm) endif()