[build] Support gRPC golang bindings in proto_library().

This CL adds a new parameter named 'generate_go_grpc' to the
'proto_library()' template, which is enabled to indicate that a
gRPC go stub, instead of a regular one, should be generated by
the template call.

This will call 'protoc-gen-go-grpc' instead of 'protoc-gen-go'
and will add a suffix of '_grpb.pb.go', instead of '.pb.go' to
the generated source file.

Bug: 72810
Change-Id: I0ae9595ce0ade7611764c1bec294fdcdb8faa9b2
1 file changed
tree: ca419a445d9c18a7a5e35c1f332acc760677ebcd
  1. test/
  2. AUTHORS
  3. BUILD.gn
  4. CONTRIBUTING.md
  5. LICENSE
  6. OWNERS
  7. PATENTS
  8. proto_library.gni
  9. protoc_wrapper.py
  10. README.md
README.md

Protocol Buffers GN Build Support

This repository contains GN build system support for Protocol Buffers. It's in its own repository because it needs to be shared by Fuchsia and Cobalt.

This repo should be checked out such that:

  • It is in //build/secondary/third_party/protobuf.
  • Protobuf is in //third_party/protobuf.
  • //.gn contains secondary_source = "//build/secondary/"

See the GN documentation on secondary_source.