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/compiler.go b/cc/compiler.go
index 7e8e8b8..9b69114 100644
--- a/cc/compiler.go
+++ b/cc/compiler.go
@@ -160,7 +160,7 @@
type baseCompiler struct {
Properties BaseCompilerProperties
Proto android.ProtoProperties
- genDeps android.Paths
+ cFlagsDeps android.Paths
pathDeps android.Paths
flags builderFlags
@@ -548,16 +548,16 @@
srcs := append(android.Paths(nil), compiler.srcsBeforeGen...)
srcs, genDeps := genSources(ctx, srcs, buildFlags)
- pathDeps = append(pathDeps, flags.CFlagsDeps...)
+ pathDeps = append(pathDeps, genDeps...)
compiler.pathDeps = pathDeps
- compiler.genDeps = genDeps
+ compiler.cFlagsDeps = flags.CFlagsDeps
// Save src, buildFlags and context
compiler.srcs = srcs
// Compile files listed in c.Properties.Srcs into objects
- objs := compileObjs(ctx, buildFlags, "", srcs, pathDeps, genDeps)
+ objs := compileObjs(ctx, buildFlags, "", srcs, pathDeps, compiler.cFlagsDeps)
if ctx.Failed() {
return Objects{}
@@ -568,7 +568,7 @@
// Compile a list of source files into objects a specified subdirectory
func compileObjs(ctx android.ModuleContext, flags builderFlags,
- subdir string, srcFiles, pathDeps android.Paths, genDeps android.Paths) Objects {
+ subdir string, srcFiles, pathDeps android.Paths, cFlagsDeps android.Paths) Objects {
- return TransformSourceToObj(ctx, subdir, srcFiles, flags, pathDeps, genDeps)
+ return TransformSourceToObj(ctx, subdir, srcFiles, flags, pathDeps, cFlagsDeps)
}