Account for .exe executable suffixes on Windows

It seems to me like proto_library.gni is missing some logic for handling
adding .exe to plugin_path on Windows.

Perfetto's proto_library template uses a _host_executable_suffix variable
to handle this:
https://android.googlesource.com/platform/external/perfetto/+/refs/heads/master/gn/standalone/proto_library.gni#71

I have added a similar variable in this change.

I would like to add this behavior even though Fuchsia does not support
building on Windows, because the Dart team would like to use protobuf-gn
to build protos in the Dart SDK. See https://dart-review.googlesource.com/c/sdk/+/278942/17/runtime/vm/BUILD.gn#89

This change patches the only missing functionality for our needs.
Ideally, this change can be applied to protobuf-gn, so we can avoid
having to create our own fork.

Change-Id: I7954c07c38ea5a8410bd7262074fdec7f0d611f1
1 file changed
tree: e2e0e8fe3ce90671cd826ffb2f85ef0d509e1fa7
  1. AUTHORS
  2. BUILD.gn
  3. BUILD.input.gn
  4. CONTRIBUTING.md
  5. gen.py
  6. LICENSE
  7. OWNERS
  8. PATENTS
  9. proto_library.gni
  10. protoc_wrapper.py
  11. 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.