Merge "Make installable arch-variant and static vs shared variant for cc modules" am: 4985224198
am: 5dc0ab4daa
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1874552 Change-Id: I7bdfd8ec00a798076d00a5b893bf54397a0e6e0f
This commit is contained in:
9
cc/cc.go
9
cc/cc.go
@@ -325,7 +325,7 @@ type BaseProperties struct {
|
|||||||
SnapshotStaticLibs []string `blueprint:"mutated"`
|
SnapshotStaticLibs []string `blueprint:"mutated"`
|
||||||
SnapshotRuntimeLibs []string `blueprint:"mutated"`
|
SnapshotRuntimeLibs []string `blueprint:"mutated"`
|
||||||
|
|
||||||
Installable *bool
|
Installable *bool `android:"arch_variant"`
|
||||||
|
|
||||||
// Set by factories of module types that can only be referenced from variants compiled against
|
// Set by factories of module types that can only be referenced from variants compiled against
|
||||||
// the SDK.
|
// the SDK.
|
||||||
@@ -1865,7 +1865,7 @@ func (c *Module) maybeUnhideFromMake() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Module) maybeInstall(ctx ModuleContext, apexInfo android.ApexInfo) {
|
func (c *Module) maybeInstall(ctx ModuleContext, apexInfo android.ApexInfo) {
|
||||||
if !proptools.BoolDefault(c.Properties.Installable, true) {
|
if !proptools.BoolDefault(c.Installable(), true) {
|
||||||
// If the module has been specifically configure to not be installed then
|
// If the module has been specifically configure to not be installed then
|
||||||
// hide from make as otherwise it will break when running inside make
|
// hide from make as otherwise it will break when running inside make
|
||||||
// as the output path to install will not be specified. Not all uninstallable
|
// as the output path to install will not be specified. Not all uninstallable
|
||||||
@@ -3260,6 +3260,11 @@ func (c *Module) PreventInstall() bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Module) Installable() *bool {
|
func (c *Module) Installable() *bool {
|
||||||
|
if c.library != nil {
|
||||||
|
if i := c.library.installable(); i != nil {
|
||||||
|
return i
|
||||||
|
}
|
||||||
|
}
|
||||||
return c.Properties.Installable
|
return c.Properties.Installable
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -123,7 +123,7 @@ func IsValidSharedDependency(dependency android.Module) bool {
|
|||||||
}
|
}
|
||||||
// Discard installable:false libraries because they are expected to be absent
|
// Discard installable:false libraries because they are expected to be absent
|
||||||
// in runtime.
|
// in runtime.
|
||||||
if !proptools.BoolDefault(ccLibrary.Properties.Installable, true) {
|
if !proptools.BoolDefault(ccLibrary.Installable(), true) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -159,6 +159,8 @@ type StaticOrSharedProperties struct {
|
|||||||
Export_static_lib_headers []string `android:"arch_variant"`
|
Export_static_lib_headers []string `android:"arch_variant"`
|
||||||
|
|
||||||
Apex_available []string `android:"arch_variant"`
|
Apex_available []string `android:"arch_variant"`
|
||||||
|
|
||||||
|
Installable *bool `android:"arch_variant"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type LibraryMutatedProperties struct {
|
type LibraryMutatedProperties struct {
|
||||||
@@ -1048,6 +1050,8 @@ type libraryInterface interface {
|
|||||||
availableFor(string) bool
|
availableFor(string) bool
|
||||||
|
|
||||||
getAPIListCoverageXMLPath() android.ModuleOutPath
|
getAPIListCoverageXMLPath() android.ModuleOutPath
|
||||||
|
|
||||||
|
installable() *bool
|
||||||
}
|
}
|
||||||
|
|
||||||
type versionedInterface interface {
|
type versionedInterface interface {
|
||||||
@@ -1972,6 +1976,15 @@ func (library *libraryDecorator) availableFor(what string) bool {
|
|||||||
return android.CheckAvailableForApex(what, list)
|
return android.CheckAvailableForApex(what, list)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (library *libraryDecorator) installable() *bool {
|
||||||
|
if library.static() {
|
||||||
|
return library.StaticProperties.Static.Installable
|
||||||
|
} else if library.shared() {
|
||||||
|
return library.SharedProperties.Shared.Installable
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
func (library *libraryDecorator) makeUninstallable(mod *Module) {
|
func (library *libraryDecorator) makeUninstallable(mod *Module) {
|
||||||
if library.static() && library.buildStatic() && !library.buildStubs() {
|
if library.static() && library.buildStatic() && !library.buildStubs() {
|
||||||
// If we're asked to make a static library uninstallable we don't do
|
// If we're asked to make a static library uninstallable we don't do
|
||||||
|
Reference in New Issue
Block a user