summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Yi-Yo Chiang <yochiang@google.com> 2021-07-30 10:09:40 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2021-07-30 10:09:40 +0000
commitd7b95f94a1bc79c2354460ce4b9986abb907e17b (patch)
tree0d05daa7b36b06071af76af68b95cfa1fedb61f6
parent54d2e21fa84d7f85bbabc89f06d19e2f5b4b30f6 (diff)
parentc7e044f53100ac5d5eeecebb662a37d789b7c7e8 (diff)
Merge changes from topic "variational-required"
* changes: cc/cc.go: Support per-image-variation "required" android/androidmk.go: Calls *RequiredModuleNames() to get required modules
-rw-r--r--android/androidmk.go6
-rw-r--r--cc/cc.go30
2 files changed, 33 insertions, 3 deletions
diff --git a/android/androidmk.go b/android/androidmk.go
index 557e7bac8..f032f1bd4 100644
--- a/android/androidmk.go
+++ b/android/androidmk.go
@@ -486,9 +486,9 @@ func (a *AndroidMkEntries) fillInEntries(ctx fillInEntriesContext, mod blueprint
if a.Include == "" {
a.Include = "$(BUILD_PREBUILT)"
}
- a.Required = append(a.Required, amod.commonProperties.Required...)
- a.Host_required = append(a.Host_required, amod.commonProperties.Host_required...)
- a.Target_required = append(a.Target_required, amod.commonProperties.Target_required...)
+ a.Required = append(a.Required, mod.(Module).RequiredModuleNames()...)
+ a.Host_required = append(a.Host_required, mod.(Module).HostRequiredModuleNames()...)
+ a.Target_required = append(a.Target_required, mod.(Module).TargetRequiredModuleNames()...)
for _, distString := range a.GetDistForGoals(mod) {
fmt.Fprintf(&a.header, distString)
diff --git a/cc/cc.go b/cc/cc.go
index 7aec7f21a..1ee113765 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -354,6 +354,24 @@ type BaseProperties struct {
// can depend on libraries that are not exported by the APEXes and use private symbols
// from the exported libraries.
Test_for []string `android:"arch_variant"`
+
+ Target struct {
+ Platform struct {
+ // List of modules required by the core variant.
+ Required []string `android:"arch_variant"`
+
+ // List of modules not required by the core variant.
+ Exclude_required []string `android:"arch_variant"`
+ } `android:"arch_variant"`
+
+ Recovery struct {
+ // List of modules required by the recovery variant.
+ Required []string `android:"arch_variant"`
+
+ // List of modules not required by the recovery variant.
+ Exclude_required []string `android:"arch_variant"`
+ } `android:"arch_variant"`
+ } `android:"arch_variant"`
}
type VendorProperties struct {
@@ -865,6 +883,18 @@ func (c *Module) HiddenFromMake() bool {
return c.Properties.HideFromMake
}
+func (c *Module) RequiredModuleNames() []string {
+ required := android.CopyOf(c.ModuleBase.RequiredModuleNames())
+ if c.ImageVariation().Variation == android.CoreVariation {
+ required = append(required, c.Properties.Target.Platform.Required...)
+ required = removeListFromList(required, c.Properties.Target.Platform.Exclude_required)
+ } else if c.InRecovery() {
+ required = append(required, c.Properties.Target.Recovery.Required...)
+ required = removeListFromList(required, c.Properties.Target.Recovery.Exclude_required)
+ }
+ return android.FirstUniqueStrings(required)
+}
+
func (c *Module) Toc() android.OptionalPath {
if c.linker != nil {
if library, ok := c.linker.(libraryInterface); ok {