[clangd] add CLANG_ENABLE_CLANGD option to build clangd. Require threads.
authorSam McCall <sam.mccall@gmail.com>
Tue, 7 May 2019 07:05:47 +0000 (07:05 +0000)
committerSam McCall <sam.mccall@gmail.com>
Tue, 7 May 2019 07:05:47 +0000 (07:05 +0000)
Reviewers: gribozavr

Subscribers: mgorny, ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D61518

llvm-svn: 360115

clang-tools-extra/CMakeLists.txt

index d32b4b9..dbb89e6 100644 (file)
@@ -1,3 +1,5 @@
+include(CMakeDependentOption)
+
 add_subdirectory(clang-apply-replacements)
 add_subdirectory(clang-reorder-fields)
 add_subdirectory(modularize)
@@ -9,7 +11,6 @@ add_subdirectory(clang-doc)
 add_subdirectory(clang-include-fixer)
 add_subdirectory(clang-move)
 add_subdirectory(clang-query)
-add_subdirectory(clangd)
 add_subdirectory(pp-trace)
 add_subdirectory(tool-template)
 
@@ -25,3 +26,9 @@ if( CLANG_TOOLS_EXTRA_INCLUDE_DOCS )
   add_subdirectory(docs)
 endif()
 
+# clangd has its own CMake tree. It requires threads.
+CMAKE_DEPENDENT_OPTION(CLANG_ENABLE_CLANGD "Build clangd language server" ON
+                       "LLVM_ENABLE_THREADS" OFF)
+if (CLANG_ENABLE_CLANGD)
+  add_subdirectory(clangd)
+endif()