summaryrefslogtreecommitdiff
path: root/cc/cc.go
diff options
context:
space:
mode:
Diffstat (limited to 'cc/cc.go')
-rw-r--r--cc/cc.go14
1 files changed, 13 insertions, 1 deletions
diff --git a/cc/cc.go b/cc/cc.go
index c07e35850..36f04624e 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -1744,7 +1744,7 @@ func (ctx *moduleContextImpl) useClangLld(actx ModuleContext) bool {
}
func (ctx *moduleContextImpl) baseModuleName() string {
- return ctx.mod.ModuleBase.BaseModuleName()
+ return ctx.mod.BaseModuleName()
}
func (ctx *moduleContextImpl) getVndkExtendsModuleName() string {
@@ -4173,6 +4173,18 @@ func (c *Module) Partition() string {
return ""
}
+type sourceModuleName interface {
+ sourceModuleName() string
+}
+
+func (c *Module) BaseModuleName() string {
+ if smn, ok := c.linker.(sourceModuleName); ok && smn.sourceModuleName() != "" {
+ // if the prebuilt module sets a source_module_name in Android.bp, use that
+ return smn.sourceModuleName()
+ }
+ return c.ModuleBase.BaseModuleName()
+}
+
var Bool = proptools.Bool
var BoolDefault = proptools.BoolDefault
var BoolPtr = proptools.BoolPtr