aboutsummaryrefslogtreecommitdiffstats
path: root/common/module.go
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2016-02-09 17:43:51 -0800
committerDan Willemsen <dwillemsen@google.com>2016-02-09 19:56:22 -0800
commit97750520a4ab0c4a7653a254f56ac5ac4148d37a (patch)
tree7170182d62f8a20fe0a16d84bdc24ee4d18e7d21 /common/module.go
parent07cd051a176589fda0ad6a5a2fa6793960c50fbb (diff)
downloadbuild_soong-97750520a4ab0c4a7653a254f56ac5ac4148d37a.tar.gz
build_soong-97750520a4ab0c4a7653a254f56ac5ac4148d37a.tar.bz2
build_soong-97750520a4ab0c4a7653a254f56ac5ac4148d37a.zip
Refactor Android.mk generation
Now, instead of combining multiple binaries into a single BUILD_PREBUILT definition, use separate instances for every module variant. This fixes HOST vs HOST_CROSS prebuilts, and should be saner overall. From make, these should look the same, we're only just using one instance of prebuilt_internal per BUILD_PREBUILT call instead of multiple. With that simplification, we don't have to store as much state, and can directly write into the buffer. Also switch from io.WriteString to fmt.Fprintln, which will require fewer explicit string concatentations, and we don't need to worry about newlines. Allow the module-provided functions to return errors. Change-Id: If30453b21fa21387f635626618d8fabfc78e6859
Diffstat (limited to 'common/module.go')
-rw-r--r--common/module.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/common/module.go b/common/module.go
index ad2ba4e7..844db7f6 100644
--- a/common/module.go
+++ b/common/module.go
@@ -255,6 +255,14 @@ func (a *AndroidModuleBase) HostType() HostType {
return a.commonProperties.CompileHostType
}
+func (a *AndroidModuleBase) Host() bool {
+ return a.HostOrDevice().Host()
+}
+
+func (a *AndroidModuleBase) Arch() Arch {
+ return a.commonProperties.CompileArch
+}
+
func (a *AndroidModuleBase) HostSupported() bool {
return a.commonProperties.HostOrDeviceSupported == HostSupported ||
a.commonProperties.HostOrDeviceSupported == HostAndDeviceSupported &&