rust: Don't append '.vendor' to vendor modules.

Rust vendor-only modules would have the '.vendor' subname appended to
them, which meant that 'm <vendor_module>' would not work -- instead
you would need to call 'm <vendor_module>.vendor', which leads to some
confusion.

This CL fixes the behavior by using the same SubName logic as the cc
module.

Bug: 205577906
Test: m <vendor_module> # works without .vendor suffix
Change-Id: I6ba18ce1d7281a1f8342ed6014644b48009d78e0
This commit is contained in:
Ivan Lozano
2022-04-12 13:08:36 -04:00
parent d72c85219a
commit f1868af5d5
3 changed files with 49 additions and 35 deletions

View File

@@ -332,6 +332,20 @@ func (mod *Module) IsVndkSp() bool {
return false
}
func (mod *Module) IsVndkPrebuiltLibrary() bool {
// Rust modules do not provide VNDK prebuilts
return false
}
func (mod *Module) IsVendorPublicLibrary() bool {
return mod.VendorProperties.IsVendorPublicLibrary
}
func (mod *Module) SdkAndPlatformVariantVisibleToMake() bool {
// Rust modules to not provide Sdk variants
return false
}
func (c *Module) IsVndkPrivate() bool {
return false
}
@@ -841,24 +855,7 @@ func (mod *Module) GenerateAndroidBuildActions(actx android.ModuleContext) {
toolchain := mod.toolchain(ctx)
mod.makeLinkType = cc.GetMakeLinkType(actx, mod)
// Differentiate static libraries that are vendor available
if mod.UseVndk() {
if mod.InProduct() && !mod.OnlyInProduct() {
mod.Properties.SubName += cc.ProductSuffix
} else {
mod.Properties.SubName += cc.VendorSuffix
}
} else if mod.InRamdisk() && !mod.OnlyInRamdisk() {
mod.Properties.SubName += cc.RamdiskSuffix
} else if mod.InVendorRamdisk() && !mod.OnlyInVendorRamdisk() {
mod.Properties.SubName += cc.VendorRamdiskSuffix
} else if mod.InRecovery() && !mod.OnlyInRecovery() {
mod.Properties.SubName += cc.RecoverySuffix
}
if mod.Target().NativeBridge == android.NativeBridgeEnabled {
mod.Properties.SubName += cc.NativeBridgeSuffix
}
mod.Properties.SubName = cc.GetSubnameProperty(actx, mod)
if !toolchain.Supported() {
// This toolchain's unsupported, there's nothing to do for this mod.