[clangd] Fix remote index build without shared libs mode
authorKirill Bobyrev <kbobyrev@google.com>
Tue, 28 Apr 2020 17:15:49 +0000 (19:15 +0200)
committerKirill Bobyrev <kbobyrev@google.com>
Tue, 28 Apr 2020 17:16:37 +0000 (19:16 +0200)
commit9ff3f339e881b65217272cb11714493d0e5f1c70
tree25ceb2d080354e5fcac681419f0f2cbd4a9a85fc
parent707df4acdc5fa607af4cd9d4106c423ae0f5ba21
[clangd] Fix remote index build without shared libs mode

Summary:
Generated Protobuf library has to be in CLANG_EXPORTS and should also be
installed appropriately. The easiest way to do that is via CMake's
add_clang_library. That unfortunately applies "one directory - one
clang_(library|tool)" policy so .proto files should be in a separate directory
and complicates the layout.

This setup works both in shared and static libs mode.

Resolves: https://github.com/clangd/clangd/issues/351

Reviewers: sammccall

Reviewed By: sammccall

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

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D78885
clang-tools-extra/clangd/index/remote/server/CMakeLists.txt
llvm/cmake/modules/FindGRPC.cmake
llvm/cmake/modules/LLVMProcessSources.cmake