[CMake] Fix FindGRPC cmake module to allow different layering
authorSteven Wu <stevenwu@apple.com>
Wed, 12 Oct 2022 22:25:43 +0000 (15:25 -0700)
committerSteven Wu <stevenwu@apple.com>
Wed, 12 Oct 2022 22:35:26 +0000 (15:35 -0700)
commit4ba360d499f6169d62a9535438b3cf34337ffc67
treee2e7c24ce92cb03d2e9980cc41fe62654186aafb
parente669e2bd97e736bab5de331249ceb31c8bdc7127
[CMake] Fix FindGRPC cmake module to allow different layering

Take the library target out of `generate_protos` function so the caller
can decide where to layer the library using the source generated from
the function.

Fixes: https://github.com/llvm/llvm-project/issues/58075

Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D135712
clang-tools-extra/clangd/CMakeLists.txt
clang-tools-extra/clangd/index/remote/CMakeLists.txt
clang/cmake/modules/AddGRPC.cmake [new file with mode: 0644]
cmake/Modules/FindGRPC.cmake [moved from llvm/cmake/modules/FindGRPC.cmake with 97% similarity]