From ab9f4268c01390b9d049c746e399b53a0f2c6dce Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Wed, 14 Feb 2018 13:58:34 -0800 Subject: Add proto.canonical_path_from_root Historically, we've always passed '-I .' as the first argument to protoc, essentially treating all proto file package names as their full path in the android source tree. This would make sense in a monorepo world, but it makes less sense when we're pulling in external projects with established package names. So keep the same default (for now), but allow individual builds to opt into using local paths as the default names with 'canonical_path_from_root: false'. A cleanup effort and/or large scale change in the future could change the default to false. As part of this, run protoc once per input proto file, since the flags may need to change per-file. We'll also need this in order to specify --dependency_out in the future. Bug: 70704330 Test: aosp/master build-aosp_arm.ninja is identical Test: aosp/master soong/build.ninja has expected changes Test: m Test: Build protobuf test Change-Id: I9d6de9fd630326bbcced1c62a4a7e9546429b0ce --- cc/builder.go | 1 + 1 file changed, 1 insertion(+) (limited to 'cc/builder.go') diff --git a/cc/builder.go b/cc/builder.go index 8f253caa..1d12b5f0 100644 --- a/cc/builder.go +++ b/cc/builder.go @@ -252,6 +252,7 @@ type builderFlags struct { tidy bool coverage bool sAbiDump bool + protoRoot bool systemIncludeFlags string -- cgit v1.2.3