aboutsummaryrefslogtreecommitdiffstats
path: root/android/androidmk.go
diff options
context:
space:
mode:
authordimitry <dimitry@google.com>2019-03-26 12:39:31 +0100
committerdimitry <dimitry@google.com>2019-05-03 15:33:28 +0200
commit1f33e40972c18255188ca02877fb44e633cf2782 (patch)
treee69a2b23872dacf064ac8ed1f5221691cac91c19 /android/androidmk.go
parent0e7dbebe7e4207478448edf5dc39c6ece5319895 (diff)
downloadbuild_soong-1f33e40972c18255188ca02877fb44e633cf2782.tar.gz
build_soong-1f33e40972c18255188ca02877fb44e633cf2782.tar.bz2
build_soong-1f33e40972c18255188ca02877fb44e633cf2782.zip
Add native_bridge target to Android.bp
This allows us to build guest libraries for the native bridge for arm/arm64 architectures. Bug: http://b/77159578 Test: make Change-Id: I35520ca456105ddadd456c78a4eb1e6de39147c5
Diffstat (limited to 'android/androidmk.go')
-rw-r--r--android/androidmk.go25
1 files changed, 24 insertions, 1 deletions
diff --git a/android/androidmk.go b/android/androidmk.go
index 2a3748e3..2bbd452b 100644
--- a/android/androidmk.go
+++ b/android/androidmk.go
@@ -28,6 +28,10 @@ import (
"github.com/google/blueprint/bootstrap"
)
+var (
+ NativeBridgeSuffix = ".native_bridge"
+)
+
func init() {
RegisterSingletonType("androidmk", AndroidMkSingleton)
}
@@ -161,6 +165,10 @@ func (a *AndroidMkEntries) fillInEntries(config Config, bpPath string, mod bluep
}
}
+ if amod.Target().NativeBridge {
+ a.SubName += NativeBridgeSuffix
+ }
+
fmt.Fprintln(&a.header, "\ninclude $(CLEAR_VARS)")
// Collect make variable assignment entries.
@@ -190,7 +198,22 @@ func (a *AndroidMkEntries) fillInEntries(config Config, bpPath string, mod bluep
case Device:
// Make cannot identify LOCAL_MODULE_TARGET_ARCH:= common.
if archStr != "common" {
- a.SetString("LOCAL_MODULE_TARGET_ARCH", archStr)
+ if amod.Target().NativeBridge {
+ // TODO: Unhardcode these rules.
+ guestArchStr := archStr
+ hostArchStr := ""
+ if guestArchStr == "arm" {
+ hostArchStr = "x86"
+ } else if guestArchStr == "arm64" {
+ hostArchStr = "x86_64"
+ }
+
+ if hostArchStr != "" {
+ a.SetString("LOCAL_MODULE_TARGET_ARCH", hostArchStr)
+ }
+ } else {
+ a.SetString("LOCAL_MODULE_TARGET_ARCH", archStr)
+ }
}
a.AddStrings("LOCAL_INIT_RC", amod.commonProperties.Init_rc...)