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/library.go b/cc/library.go
index 00282fc..54c5476 100644
--- a/cc/library.go
+++ b/cc/library.go
@@ -384,11 +384,11 @@
if library.static() {
srcs := android.PathsForModuleSrc(ctx, library.Properties.Static.Srcs)
objs = objs.Append(compileObjs(ctx, buildFlags, android.DeviceStaticLibrary,
- srcs, library.baseCompiler.pathDeps, library.baseCompiler.genDeps))
+ srcs, library.baseCompiler.pathDeps, library.baseCompiler.cFlagsDeps))
} else if library.shared() {
srcs := android.PathsForModuleSrc(ctx, library.Properties.Shared.Srcs)
objs = objs.Append(compileObjs(ctx, buildFlags, android.DeviceSharedLibrary,
- srcs, library.baseCompiler.pathDeps, library.baseCompiler.genDeps))
+ srcs, library.baseCompiler.pathDeps, library.baseCompiler.cFlagsDeps))
}
return objs
@@ -676,8 +676,8 @@
}
library.reexportFlags(flags)
library.reuseExportedFlags = append(library.reuseExportedFlags, flags...)
- library.reexportDeps(library.baseCompiler.genDeps) // TODO: restrict to aidl deps
- library.reuseExportedDeps = append(library.reuseExportedDeps, library.baseCompiler.genDeps...)
+ library.reexportDeps(library.baseCompiler.pathDeps) // TODO: restrict to aidl deps
+ library.reuseExportedDeps = append(library.reuseExportedDeps, library.baseCompiler.pathDeps...)
}
}
@@ -689,8 +689,8 @@
}
library.reexportFlags(flags)
library.reuseExportedFlags = append(library.reuseExportedFlags, flags...)
- library.reexportDeps(library.baseCompiler.genDeps) // TODO: restrict to proto deps
- library.reuseExportedDeps = append(library.reuseExportedDeps, library.baseCompiler.genDeps...)
+ library.reexportDeps(library.baseCompiler.pathDeps) // TODO: restrict to proto deps
+ library.reuseExportedDeps = append(library.reuseExportedDeps, library.baseCompiler.pathDeps...)
}
}