tstellar / rpms / llvm

Forked from rpms/llvm 4 years ago
Clone
7a52d8c
From 9c50cf0c6d8f0b11cd76a28cc4ef9bca6ef732e0 Mon Sep 17 00:00:00 2001
7a52d8c
From: Tom Stellard <tstellar@redhat.com>
7a52d8c
Date: Tue, 9 May 2017 01:41:28 +0000
7a52d8c
Subject: [PATCH] Revert "Revert "CMake: Move sphinx detection into
7a52d8c
 AddSphinxTarget.cmake""
7a52d8c
7a52d8c
This reverts commit r302054.
7a52d8c
7a52d8c
Re-commit now that I have fixes for clang/lld.
7a52d8c
7a52d8c
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302499 91177308-0d34-0410-b5e6-96231b3b80d8
7a52d8c
---
7a52d8c
 cmake/config-ix.cmake               | 10 ----------
7a52d8c
 cmake/modules/AddSphinxTarget.cmake | 13 +++++++++++++
7a52d8c
 docs/CMakeLists.txt                 |  2 +-
7a52d8c
 3 files changed, 14 insertions(+), 11 deletions(-)
7a52d8c
7a52d8c
diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake
7a52d8c
index 0331d0f..de8e9bf 100755
7a52d8c
--- a/cmake/config-ix.cmake
7a52d8c
+++ b/cmake/config-ix.cmake
7a52d8c
@@ -530,16 +530,6 @@ else()
7a52d8c
   message(STATUS "Doxygen disabled.")
7a52d8c
 endif()
7a52d8c
 
7a52d8c
-if (LLVM_ENABLE_SPHINX)
7a52d8c
-  message(STATUS "Sphinx enabled.")
7a52d8c
-  find_package(Sphinx REQUIRED)
7a52d8c
-  if (LLVM_BUILD_DOCS)
7a52d8c
-    add_custom_target(sphinx ALL)
7a52d8c
-  endif()
7a52d8c
-else()
7a52d8c
-  message(STATUS "Sphinx disabled.")
7a52d8c
-endif()
7a52d8c
-
7a52d8c
 set(LLVM_BINDINGS "")
7a52d8c
 if(WIN32)
7a52d8c
   message(STATUS "Go bindings disabled.")
7a52d8c
diff --git a/cmake/modules/AddSphinxTarget.cmake b/cmake/modules/AddSphinxTarget.cmake
7a52d8c
index cfc7f38..c3a676d 100644
7a52d8c
--- a/cmake/modules/AddSphinxTarget.cmake
7a52d8c
+++ b/cmake/modules/AddSphinxTarget.cmake
7a52d8c
@@ -1,3 +1,16 @@
7a52d8c
+
7a52d8c
+# Create sphinx target
7a52d8c
+if (LLVM_ENABLE_SPHINX AND NOT TARGET sphinx)
7a52d8c
+  message(STATUS "Sphinx enabled.")
7a52d8c
+  find_package(Sphinx REQUIRED)
7a52d8c
+  if (LLVM_BUILD_DOCS)
7a52d8c
+    add_custom_target(sphinx ALL)
7a52d8c
+  endif()
7a52d8c
+else()
7a52d8c
+  message(STATUS "Sphinx disabled.")
7a52d8c
+endif()
7a52d8c
+
7a52d8c
+
7a52d8c
 # Handy function for creating the different Sphinx targets.
7a52d8c
 #
7a52d8c
 # ``builder`` should be one of the supported builders used by
7a52d8c
diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt
7a52d8c
index 6dff219..4437610 100644
7a52d8c
--- a/docs/CMakeLists.txt
7a52d8c
+++ b/docs/CMakeLists.txt
7a52d8c
@@ -103,8 +103,8 @@ endif()
7a52d8c
 endif()
7a52d8c
 
7a52d8c
 if (LLVM_ENABLE_SPHINX)
7a52d8c
+  include(AddSphinxTarget)
7a52d8c
   if (SPHINX_FOUND)
7a52d8c
-    include(AddSphinxTarget)
7a52d8c
     if (${SPHINX_OUTPUT_HTML})
7a52d8c
       add_sphinx_target(html llvm)
7a52d8c
     endif()
7a52d8c
-- 
7a52d8c
1.8.3.1
7a52d8c