Convert more of art to Android.bp
Relanding I1b10f140e17dd5e12a9d7f6a29d47cf61f5bf6ef, with fixes to
compile dalvikvm32 and dalvikvm64, and add them as dependencies of
tests. Also fixes HOST_PREFER_32_BIT by moving the override from the
defaults, which are not used by everything in art, to the art_cc_binary
module type.
Test: rm -rf out/host; m -j HOST_PREFER_32_BIT test-art-host; m -j test-art-host
Change-Id: I64d3eef5080e128103d052497760c3521cc253c6
diff --git a/build/art.go b/build/art.go
index d41b407..9cab3b9 100644
--- a/build/art.go
+++ b/build/art.go
@@ -137,7 +137,26 @@
p.Target.Android.Cflags = deviceFlags(ctx)
p.Target.Host.Cflags = hostFlags(ctx)
ctx.AppendProperties(p)
+}
+type artGlobalDefaults struct{}
+
+func (a *artCustomLinkerCustomizer) CustomizeProperties(ctx android.CustomizePropertiesContext) {
+ linker := envDefault(ctx, "CUSTOM_TARGET_LINKER", "")
+ if linker != "" {
+ type props struct {
+ DynamicLinker string
+ }
+
+ p := &props{}
+ p.DynamicLinker = linker
+ ctx.AppendProperties(p)
+ }
+}
+
+type artCustomLinkerCustomizer struct{}
+
+func (a *artPrefer32BitCustomizer) CustomizeProperties(ctx android.CustomizePropertiesContext) {
if envTrue(ctx, "HOST_PREFER_32_BIT") {
type props struct {
Target struct {
@@ -153,22 +172,7 @@
}
}
-type artGlobalDefaults struct{}
-
-func (a *artLinkerCustomizer) CustomizeProperties(ctx android.CustomizePropertiesContext) {
- linker := envDefault(ctx, "CUSTOM_TARGET_LINKER", "")
- if linker != "" {
- type props struct {
- DynamicLinker string
- }
-
- p := &props{}
- p.DynamicLinker = linker
- ctx.AppendProperties(p)
- }
-}
-
-type artLinkerCustomizer struct{}
+type artPrefer32BitCustomizer struct{}
func init() {
soong.RegisterModuleType("art_cc_library", artLibrary)
@@ -200,6 +204,7 @@
c := &codegenCustomizer{}
android.AddCustomizer(library, c)
props = append(props, &c.codegenProperties)
+
return module, props
}
@@ -207,7 +212,8 @@
binary, _ := cc.NewBinary(android.HostAndDeviceSupported)
module, props := binary.Init()
- android.AddCustomizer(binary, &artLinkerCustomizer{})
+ android.AddCustomizer(binary, &artCustomLinkerCustomizer{})
+ android.AddCustomizer(binary, &artPrefer32BitCustomizer{})
return module, props
}