Clone this repo:

Branches

  1. 7a066f6 [protobuf] Add LINT.IfChange to sync visibility and config by Anivia Li · 2 weeks ago main master
  2. d6f9ad2 [protobuf] Fix gen.py and move manual BUILD.gn edits to BUILD.input.gn by Anivia Li · 2 weeks ago
  3. c978949 [protobuf] Disable -Wdeprecated-builtins by Clayton McCray · 3 weeks ago
  4. 6bf2811 Add third_party/luci-go/swarming to protoc visibility by Carver Forbes · 5 weeks ago
  5. 26d72c9 [abseil] Point protobuf dependency to new abseil location by Clayton Mccray · 5 weeks ago

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/src.
  • //.gn contains secondary_source = "//build/secondary/"

See the GN documentation on secondary_source.

Updating Build Files

WARNING: DO NOT MODIFY THE BUILD.gn FILE DIRECTLY!

The BUILD.gn file in this directory is generated automatically. Any manual changes will be overwritten.

To make changes to the build configuration:

  1. Edit the BUILD.input.gn file to suit your needs, for example managing visibility, suppressing warnings, etc.
  2. Checkout //third_party/protobuf to the target version.
  3. Run the gen.py script located in this directory to regenerate the BUILD.gn file.
  4. Commit both the updated BUILD.input.gn and the newly generated BUILD.gn file.

Failing to modify BUILD.input.gn will result in your changes being lost the next time the build file is regenerated.