Add target_arch to vndk prebuilt module name
To distinguish libfoo.vndk.$VER prebuilts of various vndk_v$VER_$ARCH phony package modules, append $ARCH to the LOCAL_MODULE name for VNDK prebuilts. e.g. libfoo.vndk.$VER becomes libfoo.vndk.$VER.$ARCH Test: m -j PRODUCT_EXTRA_VNDK_VERSIONS=27 Bug: 71370248 Change-Id: I3e9ebd929111ceb48e362c500adfb4b7a94444e8
This commit is contained in:
parent
66dbc0bc32
commit
43ef264b3a
|
@ -355,7 +355,7 @@ func (c *llndkStubDecorator) AndroidMk(ctx AndroidMkContext, ret *android.Androi
|
||||||
func (c *vndkPrebuiltLibraryDecorator) AndroidMk(ctx AndroidMkContext, ret *android.AndroidMkData) {
|
func (c *vndkPrebuiltLibraryDecorator) AndroidMk(ctx AndroidMkContext, ret *android.AndroidMkData) {
|
||||||
ret.Class = "SHARED_LIBRARIES"
|
ret.Class = "SHARED_LIBRARIES"
|
||||||
|
|
||||||
ret.SubName = vndkSuffix + c.version()
|
ret.SubName = c.NameSuffix()
|
||||||
|
|
||||||
ret.Extra = append(ret.Extra, func(w io.Writer, outputFile android.Path) {
|
ret.Extra = append(ret.Extra, func(w io.Writer, outputFile android.Path) {
|
||||||
c.libraryDecorator.androidMkWriteExportedFlags(w)
|
c.libraryDecorator.androidMkWriteExportedFlags(w)
|
||||||
|
|
|
@ -47,8 +47,11 @@ var (
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
type vndkPrebuiltProperties struct {
|
type vndkPrebuiltProperties struct {
|
||||||
// VNDK snapshot version that is formated as {SDK_ver}.{Major}.{Minor}.
|
// VNDK snapshot version.
|
||||||
Version string
|
Version *string
|
||||||
|
|
||||||
|
// Target arch name of the snapshot (e.g. 'arm64' for variant 'aosp_arm64_ab')
|
||||||
|
Target_arch *string
|
||||||
|
|
||||||
// Prebuilt files for each arch.
|
// Prebuilt files for each arch.
|
||||||
Srcs []string `android:"arch_variant"`
|
Srcs []string `android:"arch_variant"`
|
||||||
|
@ -60,15 +63,26 @@ type vndkPrebuiltLibraryDecorator struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *vndkPrebuiltLibraryDecorator) Name(name string) string {
|
func (p *vndkPrebuiltLibraryDecorator) Name(name string) string {
|
||||||
return name + vndkSuffix + p.version()
|
return name + p.NameSuffix()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *vndkPrebuiltLibraryDecorator) NameSuffix() string {
|
||||||
|
if p.arch() != "" {
|
||||||
|
return vndkSuffix + p.version() + "." + p.arch()
|
||||||
|
}
|
||||||
|
return vndkSuffix + p.version()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *vndkPrebuiltLibraryDecorator) version() string {
|
func (p *vndkPrebuiltLibraryDecorator) version() string {
|
||||||
return p.properties.Version
|
return String(p.properties.Version)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *vndkPrebuiltLibraryDecorator) arch() string {
|
||||||
|
return String(p.properties.Target_arch)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *vndkPrebuiltLibraryDecorator) linkerFlags(ctx ModuleContext, flags Flags) Flags {
|
func (p *vndkPrebuiltLibraryDecorator) linkerFlags(ctx ModuleContext, flags Flags) Flags {
|
||||||
p.libraryDecorator.libName = strings.TrimSuffix(ctx.ModuleName(), vndkSuffix+p.version())
|
p.libraryDecorator.libName = strings.TrimSuffix(ctx.ModuleName(), p.NameSuffix())
|
||||||
return p.libraryDecorator.linkerFlags(ctx, flags)
|
return p.libraryDecorator.linkerFlags(ctx, flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue