diff options
author | Dan Willemsen <dwillemsen@google.com> | 2015-11-30 16:06:01 -0800 |
---|---|---|
committer | Dan Willemsen <dwillemsen@google.com> | 2015-11-30 16:51:14 -0800 |
commit | 0effe065974221e3fe7a0a61543cc0b2bd39cf57 (patch) | |
tree | 36bf80e17c723cc82b9fd0d745c1af37e00a4659 | |
parent | 490fd4955747c9d3715954359d72937960f02a22 (diff) | |
download | build_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
-rw-r--r-- | cc/cc.go | 2 | ||||
-rw-r--r-- | common/module.go | 26 |
2 files changed, 14 insertions, 14 deletions
@@ -694,7 +694,7 @@ func (c *CCBase) depsToPathsFromList(ctx common.AndroidModuleContext, } if a, ok := m.(CCModuleType); ok { - if a.Disabled() { + if !a.Enabled() { // If a cc_library host+device module depends on a library that exists as both // cc_library_shared and cc_library_host_shared, it will end up with two // dependencies with the same name, one of which is marked disabled for each 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 } |