exports LOCAL_SOONG_VNDK_VERSION for VNDK libs
For vndk_prebuilt_shared module, it is set by 'version' property. For other vndk libs(e.g. cc_library with vndk.enabled), it is set as PLATFORM_VNDK_VERSION. Background: To support "skip installing current VNDK". You can get a system.img without current VNDK libs. This may help when you want a smaller system.img given that the image will be used with a specific version (not current) of vendor image. Bug: 132140714 Test: m TARGET_SKIP_CURRENT_VNDK=true && see if current VNDK is not installed Change-Id: I1c603efc3e95fe8bdf870f2de91994077899fca7
This commit is contained in:
@@ -89,6 +89,9 @@ func (c *Module) AndroidMk() android.AndroidMkData {
|
|||||||
fmt.Fprintln(w, "LOCAL_SOONG_LINK_TYPE :=", c.makeLinkType)
|
fmt.Fprintln(w, "LOCAL_SOONG_LINK_TYPE :=", c.makeLinkType)
|
||||||
if c.useVndk() {
|
if c.useVndk() {
|
||||||
fmt.Fprintln(w, "LOCAL_USE_VNDK := true")
|
fmt.Fprintln(w, "LOCAL_USE_VNDK := true")
|
||||||
|
if c.isVndk() && !c.static() {
|
||||||
|
fmt.Fprintln(w, "LOCAL_SOONG_VNDK_VERSION := "+c.vndkVersion())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
7
cc/cc.go
7
cc/cc.go
@@ -534,6 +534,13 @@ func (c *Module) isVndk() bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *Module) vndkVersion() string {
|
||||||
|
if vndkdep := c.vndkdep; vndkdep != nil {
|
||||||
|
return vndkdep.Properties.Vndk.Version
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
func (c *Module) isPgoCompile() bool {
|
func (c *Module) isPgoCompile() bool {
|
||||||
if pgo := c.pgo; pgo != nil {
|
if pgo := c.pgo; pgo != nil {
|
||||||
return pgo.Properties.PgoCompile
|
return pgo.Properties.PgoCompile
|
||||||
|
12
cc/vndk.go
12
cc/vndk.go
@@ -49,6 +49,10 @@ type VndkProperties struct {
|
|||||||
|
|
||||||
// Extending another module
|
// Extending another module
|
||||||
Extends *string
|
Extends *string
|
||||||
|
|
||||||
|
// for vndk_prebuilt_shared, this is set by "version" property.
|
||||||
|
// Otherwise, this is set as PLATFORM_VNDK_VERSION.
|
||||||
|
Version string `blueprint:"mutated"`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -325,6 +329,14 @@ func VndkMutator(mctx android.BottomUpMutatorContext) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if m.isVndk() {
|
||||||
|
if lib, ok := m.linker.(*vndkPrebuiltLibraryDecorator); ok {
|
||||||
|
m.vndkdep.Properties.Vndk.Version = lib.version()
|
||||||
|
} else {
|
||||||
|
m.vndkdep.Properties.Vndk.Version = mctx.DeviceConfig().PlatformVndkVersion()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if _, ok := m.linker.(*llndkStubDecorator); ok {
|
if _, ok := m.linker.(*llndkStubDecorator); ok {
|
||||||
processLlndkLibrary(mctx, m)
|
processLlndkLibrary(mctx, m)
|
||||||
return
|
return
|
||||||
|
Reference in New Issue
Block a user