protobuf: include imports when generating descriptor and add depfile

This CL adds the include_imports flag to protoc when generating
descriptors. This flag is necessary to support any sort of imports in
proto files as GN does not have support for transitively listing all
the source files in a target and its deps.

Since now include_imports silently looks at other source files other
than the ones listed in the target, this means we need a depfile to
allow ninja to pick up if changes are made in transitive dep source
files. Unfortunately, protoc's depfile generation is broken out of the
box and does not work with ninja.

Add support in the wrapper script to correct this mirror what we do in
Perfetto to achieve the same thing (see [1])


Change-Id: Ib330520232280b3a8a9eb80a397fac2f3cd1e076
Reviewed-by: Eric Seckler <>
Reviewed-by: Bruce Dawson <>
Commit-Queue: Lalit Maganti <>
Cr-Commit-Position: refs/heads/master@{#813161}
GitOrigin-RevId: c2a68d05aec4ff703654c3ac1ab0183d3c18fab2
1 file changed
tree: 3f46cb4f9569f8c9cd42d15fa65d9da3389da9bc