Files
clang-p2996/clang/cmake/modules/AddGRPC.cmake
Steven Wu 4ba360d499 [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
2022-10-12 15:35:26 -07:00

12 lines
426 B
CMake

include(FindGRPC)
function(generate_clang_protos_library LibraryName ProtoFile)
# Take the first two args and forward the remaining to generate_proto_sources.
cmake_parse_arguments(PARSE_ARGV 2 PROTO "" "" "")
generate_proto_sources(ProtoSource ${ProtoFile} ${PROTO_UNPARSED_ARGUMENTS})
add_clang_library(${LibraryName} ${ProtoSource}
PARTIAL_SOURCES_INTENDED
LINK_LIBS PUBLIC grpc++ protobuf)
endfunction()