diff --git a/clang-tools-extra/clangd/index/remote/CMakeLists.txt b/clang-tools-extra/clangd/index/remote/CMakeLists.txt --- a/clang-tools-extra/clangd/index/remote/CMakeLists.txt +++ b/clang-tools-extra/clangd/index/remote/CMakeLists.txt @@ -1,6 +1,5 @@ if (CLANGD_ENABLE_REMOTE) - generate_grpc_protos(RemoteIndexProtos "Index.proto") - include_directories(${CMAKE_CURRENT_BINARY_DIR}) + include_directories(${CMAKE_CURRENT_BINARY_DIR}/protos) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../) # FIXME(kirillbobyrev): target_compile_definitions is not working with @@ -20,6 +19,7 @@ clangDaemon ) + add_subdirectory(protos) add_subdirectory(marshalling) add_subdirectory(server) else() diff --git a/clang-tools-extra/clangd/index/remote/protos/CMakeLists.txt b/clang-tools-extra/clangd/index/remote/protos/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/clang-tools-extra/clangd/index/remote/protos/CMakeLists.txt @@ -0,0 +1 @@ +generate_grpc_protos(RemoteIndexProtos "Index.proto") diff --git a/clang-tools-extra/clangd/index/remote/Index.proto b/clang-tools-extra/clangd/index/remote/protos/Index.proto rename from clang-tools-extra/clangd/index/remote/Index.proto rename to clang-tools-extra/clangd/index/remote/protos/Index.proto diff --git a/clang-tools-extra/clangd/index/remote/server/CMakeLists.txt b/clang-tools-extra/clangd/index/remote/server/CMakeLists.txt --- a/clang-tools-extra/clangd/index/remote/server/CMakeLists.txt +++ b/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++ ) diff --git a/llvm/cmake/modules/FindGRPC.cmake b/llvm/cmake/modules/FindGRPC.cmake --- a/llvm/cmake/modules/FindGRPC.cmake +++ b/llvm/cmake/modules/FindGRPC.cmake @@ -45,6 +45,6 @@ "${ProtoSourceAbsolutePath}" DEPENDS "${ProtoSourceAbsolutePath}") - add_library(${LibraryName} ${GeneratedProtoSource} ${GeneratedGRPCSource}) - target_link_libraries(${LibraryName} grpc++ protobuf) + add_clang_library(${LibraryName} ${GeneratedProtoSource} ${GeneratedGRPCSource} + LINK_LIBS grpc++ protobuf) endfunction()