aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2015-11-30 16:06:01 -0800
committerDan Willemsen <dwillemsen@google.com>2015-11-30 16:51:14 -0800
commit0effe065974221e3fe7a0a61543cc0b2bd39cf57 (patch)
tree36bf80e17c723cc82b9fd0d745c1af37e00a4659 /common
parent490fd4955747c9d3715954359d72937960f02a22 (diff)
downloadbuild_soong-0effe065974221e3fe7a0a61543cc0b2bd39cf57.tar.gz
build_soong-0effe065974221e3fe7a0a61543cc0b2bd39cf57.tar.bz2
build_soong-0effe065974221e3fe7a0a61543cc0b2bd39cf57.zip
Change soong parameter name disabled -> enabled
This looks cleaner when we need to enable windows builds for modules. Change-Id: I61553e2124e08002b0bd9e35c1406c905718f2f7
Diffstat (limited to 'common')
-rw-r--r--common/module.go26
1 files changed, 13 insertions, 13 deletions
diff --git a/common/module.go b/common/module.go
index 7bb21a25..e11082e8 100644
--- a/common/module.go
+++ b/common/module.go
@@ -15,13 +15,12 @@
package common
import (
- "android/soong"
"path/filepath"
+ "android/soong"
"android/soong/glob"
"github.com/google/blueprint"
- "github.com/google/blueprint/proptools"
)
var (
@@ -67,7 +66,7 @@ type AndroidModule interface {
GenerateAndroidBuildActions(AndroidModuleContext)
base() *AndroidModuleBase
- Disabled() bool
+ Enabled() bool
HostOrDevice() HostOrDevice
}
@@ -76,8 +75,8 @@ type commonProperties struct {
Deps []string
Tags []string
- // don't emit any build rules for this module
- Disabled *bool `android:"arch_variant"`
+ // emit build rules for this module
+ Enabled *bool `android:"arch_variant"`
// control whether this module compiles for 32-bit, 64-bit, or both. Possible values
// are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
@@ -239,14 +238,15 @@ func (a *AndroidModuleBase) DeviceSupported() bool {
a.hostAndDeviceProperties.Device_supported
}
-func (a *AndroidModuleBase) Disabled() bool {
- if a.commonProperties.CompileHostOrDevice == Host &&
- a.commonProperties.CompileHostType == Windows &&
- a.commonProperties.Disabled == nil {
-
- return true
+func (a *AndroidModuleBase) Enabled() bool {
+ if a.commonProperties.Enabled == nil {
+ if a.HostSupported() && a.HostOrDevice().Host() && a.HostType() == Windows {
+ return false
+ } else {
+ return true
+ }
}
- return proptools.Bool(a.commonProperties.Disabled)
+ return *a.commonProperties.Enabled
}
func (a *AndroidModuleBase) computeInstallDeps(
@@ -338,7 +338,7 @@ func (a *AndroidModuleBase) GenerateBuildActions(ctx blueprint.ModuleContext) {
installFiles: a.installFiles,
}
- if a.Disabled() {
+ if !a.Enabled() {
return
}