Add only compiler-flag dependencies as implicit
Bug: http://b/72343691
Change https://android-review.googlesource.com/c/572758, in addition to
dependencies from the compiler flags, also marked all exported
dependencies as implicit. This can cause lots of unnecessary
recompiles. This change moves exported dependencies back as order-only
dependencies.
Test: 1. mma in art after changing profile_compilation_info.h triggers
only a limited number of recompiles.
2. verify that changes to PGO profile files trigger recompiles.
Change-Id: Icb0f4cd2b6da0add3b6e5206661e6aa7a577602f
diff --git a/cc/builder.go b/cc/builder.go
index fe35d5c..0646132 100644
--- a/cc/builder.go
+++ b/cc/builder.go
@@ -289,7 +289,7 @@
// Generate rules for compiling multiple .c, .cpp, or .S files to individual .o files
func TransformSourceToObj(ctx android.ModuleContext, subdir string, srcFiles android.Paths,
- flags builderFlags, pathDeps android.Paths, genDeps android.Paths) Objects {
+ flags builderFlags, pathDeps android.Paths, cFlagsDeps android.Paths) Objects {
objFiles := make(android.Paths, len(srcFiles))
var tidyFiles android.Paths
@@ -362,8 +362,8 @@
Description: "yasm " + srcFile.Rel(),
Output: objFile,
Input: srcFile,
- Implicits: pathDeps,
- OrderOnly: genDeps,
+ Implicits: cFlagsDeps,
+ OrderOnly: pathDeps,
Args: map[string]string{
"asFlags": flags.yasmFlags,
},
@@ -375,8 +375,8 @@
Description: "windres " + srcFile.Rel(),
Output: objFile,
Input: srcFile,
- Implicits: pathDeps,
- OrderOnly: genDeps,
+ Implicits: cFlagsDeps,
+ OrderOnly: pathDeps,
Args: map[string]string{
"windresCmd": gccCmd(flags.toolchain, "windres"),
"flags": flags.toolchain.WindresFlags(),
@@ -444,8 +444,8 @@
Output: objFile,
ImplicitOutputs: implicitOutputs,
Input: srcFile,
- Implicits: pathDeps,
- OrderOnly: genDeps,
+ Implicits: cFlagsDeps,
+ OrderOnly: pathDeps,
Args: map[string]string{
"cFlags": moduleCflags,
"ccCmd": ccCmd,