[clangd] Split clangd into library+executable (mainly for unit tests).
authorIlya Biryukov <ibiryukov@google.com>
Tue, 23 May 2017 08:12:45 +0000 (08:12 +0000)
committerIlya Biryukov <ibiryukov@google.com>
Tue, 23 May 2017 08:12:45 +0000 (08:12 +0000)
Summary:
This commit itself doesn't add any unit tests, but one that does will
follow shortly.

Reviewers: krasimir, bkramer

Reviewed By: bkramer

Subscribers: mgorny, klimek, cfe-commits

Tags: #clang-tools-extra

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

llvm-svn: 303616

clang-tools-extra/clangd/CMakeLists.txt
clang-tools-extra/clangd/tool/CMakeLists.txt [new file with mode: 0644]
clang-tools-extra/clangd/tool/ClangdMain.cpp [moved from clang-tools-extra/clangd/ClangdMain.cpp with 100% similarity]

index 42ce778..00529d6 100644 (file)
@@ -1,6 +1,5 @@
-add_clang_executable(clangd
+add_clang_library(clangDaemon
   ClangdLSPServer.cpp
-  ClangdMain.cpp
   ClangdServer.cpp
   ClangdUnit.cpp
   ClangdUnitStore.cpp
@@ -11,9 +10,7 @@ add_clang_executable(clangd
   ProtocolHandlers.cpp
   )
 
-install(TARGETS clangd RUNTIME DESTINATION bin)
-
-target_link_libraries(clangd
+target_link_libraries(clangDaemon
   clangBasic
   clangFormat
   clangFrontend
@@ -22,3 +19,5 @@ target_link_libraries(clangd
   clangToolingCore
   LLVMSupport
   )
+
+add_subdirectory(tool)
diff --git a/clang-tools-extra/clangd/tool/CMakeLists.txt b/clang-tools-extra/clangd/tool/CMakeLists.txt
new file mode 100644 (file)
index 0000000..7e609a3
--- /dev/null
@@ -0,0 +1,18 @@
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
+
+add_clang_executable(clangd
+  ClangdMain.cpp
+  )
+
+install(TARGETS clangd RUNTIME DESTINATION bin)
+
+target_link_libraries(clangd
+  clangBasic
+  clangDaemon
+  clangFormat
+  clangFrontend
+  clangSema
+  clangTooling
+  clangToolingCore
+  LLVMSupport
+  )