Support no configured device architectures
There are some builds where we only want to build host tools, and we may not have a valid device configuration. Support 0 device architectures and modules that don't have any configured way to build. Change-Id: I732251e1cd3cdbfafbc6ef6a550e33e653876f7c
This commit is contained in:
@@ -435,6 +435,11 @@ func ArchMutator(mctx BottomUpMutatorContext) {
|
|||||||
moduleTargets = append(moduleTargets, targets...)
|
moduleTargets = append(moduleTargets, targets...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(moduleTargets) == 0 {
|
||||||
|
module.base().commonProperties.Enabled = boolPtr(false)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
targetNames := make([]string, len(moduleTargets))
|
targetNames := make([]string, len(moduleTargets))
|
||||||
|
|
||||||
for i, target := range moduleTargets {
|
for i, target := range moduleTargets {
|
||||||
@@ -762,10 +767,7 @@ func decodeTargetProductVariables(config Config) (map[OsClass][]Target, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if variables.DeviceArch == nil {
|
if variables.DeviceArch != nil && *variables.DeviceArch != "" {
|
||||||
return nil, fmt.Errorf("No device primary architecture set")
|
|
||||||
}
|
|
||||||
|
|
||||||
addTarget(Android, *variables.DeviceArch, variables.DeviceArchVariant,
|
addTarget(Android, *variables.DeviceArch, variables.DeviceArchVariant,
|
||||||
variables.DeviceCpuVariant, variables.DeviceAbi)
|
variables.DeviceCpuVariant, variables.DeviceAbi)
|
||||||
|
|
||||||
@@ -779,6 +781,7 @@ func decodeTargetProductVariables(config Config) (map[OsClass][]Target, error) {
|
|||||||
deviceArches[1].Arch.Native = false
|
deviceArches[1].Arch.Native = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if targetErr != nil {
|
if targetErr != nil {
|
||||||
return nil, targetErr
|
return nil, targetErr
|
||||||
|
2
cc/cc.go
2
cc/cc.go
@@ -909,7 +909,7 @@ func (c *Module) depsMutator(actx android.BottomUpMutatorContext) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func depsMutator(ctx android.BottomUpMutatorContext) {
|
func depsMutator(ctx android.BottomUpMutatorContext) {
|
||||||
if c, ok := ctx.Module().(*Module); ok {
|
if c, ok := ctx.Module().(*Module); ok && c.Enabled() {
|
||||||
c.depsMutator(ctx)
|
c.depsMutator(ctx)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user