[PATCH] D78885: [clangd] Fix remote index build without shared libs mode

Kirill Bobyrev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 28 06:24:11 PDT 2020


kbobyrev updated this revision to Diff 260606.
kbobyrev added a comment.

Don't create a separate directory for proto files.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78885/new/

https://reviews.llvm.org/D78885

Files:
  clang-tools-extra/clangd/index/remote/CMakeLists.txt
  clang-tools-extra/clangd/index/remote/server/CMakeLists.txt
  llvm/cmake/modules/AddLLVM.cmake
  llvm/cmake/modules/FindGRPC.cmake
  llvm/cmake/modules/LLVMProcessSources.cmake


Index: llvm/cmake/modules/LLVMProcessSources.cmake
===================================================================
--- llvm/cmake/modules/LLVMProcessSources.cmake
+++ llvm/cmake/modules/LLVMProcessSources.cmake
@@ -57,10 +57,12 @@
 
 
 function(llvm_process_sources OUT_VAR)
-  cmake_parse_arguments(ARG "" "" "ADDITIONAL_HEADERS;ADDITIONAL_HEADER_DIRS" ${ARGN})
+  cmake_parse_arguments(ARG "DONT_CHECK_FILE_LIST" "" "ADDITIONAL_HEADERS;ADDITIONAL_HEADER_DIRS" ${ARGN})
   set(sources ${ARG_UNPARSED_ARGUMENTS})
-  llvm_check_source_file_list( ${sources} )
-  
+  if (NOT ARG_DONT_CHECK_FILE_LIST)
+    llvm_check_source_file_list(${sources})
+  endif()
+
   # This adds .td and .h files to the Visual Studio solution:
   add_td_sources(sources)
   find_all_header_files(hdrs "${ARG_ADDITIONAL_HEADER_DIRS}")
Index: llvm/cmake/modules/FindGRPC.cmake
===================================================================
--- llvm/cmake/modules/FindGRPC.cmake
+++ llvm/cmake/modules/FindGRPC.cmake
@@ -45,6 +45,7 @@
           "${ProtoSourceAbsolutePath}"
           DEPENDS "${ProtoSourceAbsolutePath}")
 
-  add_library(${LibraryName} ${GeneratedProtoSource} ${GeneratedGRPCSource})
-  target_link_libraries(${LibraryName} grpc++ protobuf)
+  add_clang_library(${LibraryName} ${GeneratedProtoSource} ${GeneratedGRPCSource}
+    DONT_CHECK_FILE_LIST
+    LINK_LIBS grpc++ protobuf)
 endfunction()
Index: llvm/cmake/modules/AddLLVM.cmake
===================================================================
--- llvm/cmake/modules/AddLLVM.cmake
+++ llvm/cmake/modules/AddLLVM.cmake
@@ -409,7 +409,7 @@
 #   )
 function(llvm_add_library name)
   cmake_parse_arguments(ARG
-    "MODULE;SHARED;STATIC;OBJECT;DISABLE_LLVM_LINK_LLVM_DYLIB;SONAME;NO_INSTALL_RPATH;COMPONENT_LIB"
+    "MODULE;SHARED;STATIC;OBJECT;DISABLE_LLVM_LINK_LLVM_DYLIB;SONAME;NO_INSTALL_RPATH;COMPONENT_LIB;DONT_CHECK_FILE_LIST"
     "OUTPUT_NAME;PLUGIN_TOOL;ENTITLEMENTS;BUNDLE_PATH"
     "ADDITIONAL_HEADERS;DEPENDS;LINK_COMPONENTS;LINK_LIBS;OBJLIBS"
     ${ARGN})
@@ -421,7 +421,11 @@
   if(ARG_OBJLIBS)
     set(ALL_FILES ${ARG_OBJLIBS})
   else()
-    llvm_process_sources(ALL_FILES ${ARG_UNPARSED_ARGUMENTS} ${ARG_ADDITIONAL_HEADERS})
+    if (ARG_DONT_CHECK_FILE_LIST)
+      llvm_process_sources(ALL_FILES ${ARG_UNPARSED_ARGUMENTS} ${ARG_ADDITIONAL_HEADERS} DONT_CHECK_FILE_LIST)
+    else()
+      llvm_process_sources(ALL_FILES ${ARG_UNPARSED_ARGUMENTS} ${ARG_ADDITIONAL_HEADERS})
+    endif()
   endif()
 
   if(ARG_MODULE)
Index: clang-tools-extra/clangd/index/remote/server/CMakeLists.txt
===================================================================
--- clang-tools-extra/clangd/index/remote/server/CMakeLists.txt
+++ clang-tools-extra/clangd/index/remote/server/CMakeLists.txt
@@ -5,14 +5,12 @@
 add_clang_executable(clangd-index-server
   Server.cpp
   )
-target_compile_definitions(clangd-index-server PRIVATE -D GOOGLE_PROTOBUF_NO_RTTI=1)
-clang_target_link_libraries(clangd-index-server
-  PRIVATE
-  clangDaemon
-  )
 target_link_libraries(clangd-index-server
   PRIVATE
-  RemoteIndexProtos
+  clangDaemon
 
+  RemoteIndexProtos
   clangdRemoteMarshalling
+
+  grpc++
   )
Index: clang-tools-extra/clangd/index/remote/CMakeLists.txt
===================================================================
--- clang-tools-extra/clangd/index/remote/CMakeLists.txt
+++ clang-tools-extra/clangd/index/remote/CMakeLists.txt
@@ -18,6 +18,8 @@
     protobuf
     grpc++
     clangDaemon
+
+    DONT_CHECK_FILE_LIST
     )
 
   add_subdirectory(marshalling)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78885.260606.patch
Type: text/x-patch
Size: 3539 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200428/c8592f9b/attachment-0001.bin>


More information about the cfe-commits mailing list