summaryrefslogtreecommitdiff
path: root/cc/proto.go
diff options
context:
space:
mode:
author Dan Willemsen <dwillemsen@google.com> 2016-11-02 20:43:13 -0700
committer Dan Willemsen <dwillemsen@google.com> 2016-11-02 21:19:11 -0700
commit21ec49068f7be873e963dd8dc5cff610539540c5 (patch)
treec99797f9e04319a88c26d8bf189d740f63744dcd /cc/proto.go
parenteb716e25590a50541c5c2b3be81ae0468ac35690 (diff)
Add subdir to GenPath
We were emulating this for proto files, standardize it and make the other generators use it as well. Test: Compare out/soong/build.ninja before/after change Test: mmma -j system/tools/hidl Change-Id: I1888c7b981749060a398387bbb9b481270bf6d75
Diffstat (limited to 'cc/proto.go')
-rw-r--r--cc/proto.go11
1 files changed, 3 insertions, 8 deletions
diff --git a/cc/proto.go b/cc/proto.go
index 3d3ca59f7..51f544898 100644
--- a/cc/proto.go
+++ b/cc/proto.go
@@ -15,8 +15,6 @@
package cc
import (
- "strings"
-
"github.com/google/blueprint"
"android/soong/android"
@@ -46,17 +44,14 @@ var (
func genProto(ctx android.ModuleContext, protoFile android.Path,
protoFlags string) (android.ModuleGenPath, android.ModuleGenPath) {
- outDir := android.PathForModuleGen(ctx, "proto")
- baseName := strings.TrimSuffix(protoFile.Base(), protoFile.Ext())
-
- outFile := android.PathForModuleGen(ctx, "proto", ctx.ModuleDir(), baseName+".pb.cc")
- headerFile := android.PathForModuleGen(ctx, "proto", ctx.ModuleDir(), baseName+".pb.h")
+ outFile := android.GenPathWithExt(ctx, "proto", protoFile, "pb.cc")
+ headerFile := android.GenPathWithExt(ctx, "proto", protoFile, "pb.h")
ctx.ModuleBuild(pctx, android.ModuleBuildParams{
Rule: proto,
Outputs: android.WritablePaths{outFile, headerFile},
Input: protoFile,
Args: map[string]string{
- "outDir": outDir.String(),
+ "outDir": protoDir(ctx).String(),
"protoFlags": protoFlags,
},
})