summaryrefslogtreecommitdiff
path: root/cc
diff options
context:
space:
mode:
Diffstat (limited to 'cc')
-rw-r--r--cc/cc.go18
-rw-r--r--cc/compiler.go4
2 files changed, 18 insertions, 4 deletions
diff --git a/cc/cc.go b/cc/cc.go
index 013229647..a91fc63a2 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -2390,7 +2390,7 @@ func (c *Module) depsToPaths(ctx android.ModuleContext) PathDeps {
if ccDep.CcLibrary() && !libDepTag.static() {
depIsStubs := ccDep.BuildStubs()
depHasStubs := VersionVariantAvailable(c) && ccDep.HasStubsVariants()
- depInSameApex := android.DirectlyInApex(c.ApexVariationName(), depName)
+ depInSameApexes := android.DirectlyInAllApexes(c.InApexes(), depName)
depInPlatform := !android.DirectlyInAnyApex(ctx, depName)
var useThisDep bool
@@ -2420,9 +2420,9 @@ func (c *Module) depsToPaths(ctx android.ModuleContext) PathDeps {
}
}
} else {
- // If building for APEX, use stubs only when it is not from
- // the same APEX
- useThisDep = (depInSameApex != depIsStubs)
+ // If building for APEX, use stubs when the parent is in any APEX that
+ // the child is not in.
+ useThisDep = (depInSameApexes != depIsStubs)
}
// when to use (unspecified) stubs, check min_sdk_version and choose the right one
@@ -2895,6 +2895,16 @@ func (c *Module) TestFor() []string {
}
}
+func (c *Module) UniqueApexVariations() bool {
+ if u, ok := c.compiler.(interface {
+ uniqueApexVariations() bool
+ }); ok {
+ return u.uniqueApexVariations()
+ } else {
+ return false
+ }
+}
+
// Return true if the module is ever installable.
func (c *Module) EverInstallable() bool {
return c.installer != nil &&
diff --git a/cc/compiler.go b/cc/compiler.go
index 4a42d07e3..e06243b50 100644
--- a/cc/compiler.go
+++ b/cc/compiler.go
@@ -556,6 +556,10 @@ func (compiler *baseCompiler) hasSrcExt(ext string) bool {
return false
}
+func (compiler *baseCompiler) uniqueApexVariations() bool {
+ return Bool(compiler.Properties.Use_apex_name_macro)
+}
+
// makeDefineString transforms a name of an APEX module into a value to be used as value for C define
// For example, com.android.foo => COM_ANDROID_FOO
func makeDefineString(name string) string {