Fix repeated ccCmd dependencies on object files
ccCmd was being added as a dependency each time through the object
file loop, tripling the size of the build.ninja file. Create a
new slice for dependencies on each object file.
Change-Id: Id768d8ea6e5300c15f0f1a5fac5fcbdfdf5e6b0a
diff --git a/cc/builder.go b/cc/builder.go
index 218c73b..ab0e40c 100644
--- a/cc/builder.go
+++ b/cc/builder.go
@@ -188,13 +188,13 @@
ccCmd = gccCmd(flags.toolchain, ccCmd)
}
- deps = append([]string{ccCmd}, deps...)
+ objDeps := append([]string{ccCmd}, deps...)
ctx.Build(pctx, blueprint.BuildParams{
Rule: cc,
Outputs: []string{objFile},
Inputs: []string{srcFile},
- Implicits: deps,
+ Implicits: objDeps,
Args: map[string]string{
"cFlags": moduleCflags,
"ccCmd": ccCmd,