Support building with latest gRPC versions (up to v1.65.0).

This commit is contained in:
Pavel Pautov 2024-07-16 14:13:31 -07:00 committed by p-pautov
parent 6ed3910afb
commit 10215eee1b

View file

@ -34,10 +34,14 @@ else()
set(gRPC_USE_PROTO_LITE ON CACHE INTERNAL "") set(gRPC_USE_PROTO_LITE ON CACHE INTERNAL "")
set(gRPC_INSTALL OFF CACHE INTERNAL "") set(gRPC_INSTALL OFF CACHE INTERNAL "")
set(gRPC_USE_SYSTEMD OFF CACHE INTERNAL "")
set(gRPC_DOWNLOAD_ARCHIVES OFF CACHE INTERNAL "")
set(gRPC_CARES_PROVIDER package CACHE INTERNAL "") set(gRPC_CARES_PROVIDER package CACHE INTERNAL "")
set(gRPC_SSL_PROVIDER package CACHE INTERNAL "") set(gRPC_SSL_PROVIDER package CACHE INTERNAL "")
set(gRPC_ZLIB_PROVIDER package CACHE INTERNAL "") set(gRPC_ZLIB_PROVIDER package CACHE INTERNAL "")
set(protobuf_INSTALL OFF CACHE INTERNAL "")
set(CMAKE_POSITION_INDEPENDENT_CODE ON) set(CMAKE_POSITION_INDEPENDENT_CODE ON)
FetchContent_MakeAvailable(grpc) FetchContent_MakeAvailable(grpc)
@ -108,8 +112,8 @@ add_custom_command(
--plugin protoc-gen-grpc=$<TARGET_FILE:gRPC::grpc_cpp_plugin> --plugin protoc-gen-grpc=$<TARGET_FILE:gRPC::grpc_cpp_plugin>
${PROTOS} ${PROTOS}
# remove inconsequential UTF8 check during serialization to aid performance # remove inconsequential UTF8 check during serialization to aid performance
COMMAND sed -i.bak COMMAND sed -i.bak -E
-e [[/ ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(/,/);/d]] -e [[/ ::(PROTOBUF_NAMESPACE_ID|google::protobuf)::internal::WireFormatLite::VerifyUtf8String\(/,/\);/d]]
${PROTO_SOURCES} ${PROTO_SOURCES}
DEPENDS ${PROTOS} protobuf::protoc gRPC::grpc_cpp_plugin DEPENDS ${PROTOS} protobuf::protoc gRPC::grpc_cpp_plugin
VERBATIM) VERBATIM)