blob: 0ecd5bc0e8c1eb14b19369384aa15faf792545fe (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
From 8dd12df445c9a35f7b1c0202eb7c74b954b0980d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
Date: Sun, 21 Aug 2016 23:31:55 +0200
Subject: [PATCH 7/7] cmake: Support stand-alone Sphinx & doxygen doc build
Copy the necessary options and configuration checks from LLVM to clang,
to support stand-alone documentation builds.
Patch: https://reviews.llvm.org/D23758
---
CMakeLists.txt | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8ed8c10..3f34d8c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -162,6 +162,43 @@ Please install Python or specify the PYTHON_EXECUTABLE CMake variable.")
endif()
endif()
+ option (LLVM_BUILD_DOCS "Build the llvm documentation." OFF)
+ option (LLVM_INCLUDE_DOCS "Generate build targets for llvm documentation." ON)
+ option (LLVM_ENABLE_DOXYGEN "Use doxygen to generate llvm API documentation." OFF)
+ option (LLVM_ENABLE_SPHINX "Use Sphinx to generate llvm documentation." OFF)
+
+ if (LLVM_ENABLE_DOXYGEN)
+ message(STATUS "Doxygen enabled.")
+ find_package(Doxygen REQUIRED)
+
+ if (DOXYGEN_FOUND)
+ # If we find doxygen and we want to enable doxygen by default create a
+ # global aggregate doxygen target for generating llvm and any/all
+ # subprojects doxygen documentation.
+ if (LLVM_BUILD_DOCS)
+ add_custom_target(doxygen ALL)
+ endif()
+
+ option(LLVM_DOXYGEN_EXTERNAL_SEARCH "Enable doxygen external search." OFF)
+ if (LLVM_DOXYGEN_EXTERNAL_SEARCH)
+ set(LLVM_DOXYGEN_SEARCHENGINE_URL "" CACHE STRING "URL to use for external search.")
+ set(LLVM_DOXYGEN_SEARCH_MAPPINGS "" CACHE STRING "Doxygen Search Mappings")
+ endif()
+ endif()
+ 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( CLANG_BUILT_STANDALONE 1 )
set(BACKEND_PACKAGE_STRING "LLVM ${LLVM_PACKAGE_VERSION}")
else()
--
2.9.3
|