summaryrefslogtreecommitdiff
path: root/android/androidmk.go
diff options
context:
space:
mode:
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 2a3748e3a..2bbd452b1 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...)