aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2015-04-30 15:08:04 -0700
committerColin Cross <ccross@android.com>2015-04-30 16:35:06 -0700
commitb05bff2f26fd0c1fbc4f31e66e0dcfc4ab883f7e (patch)
treed6a6c5e607f73e183e62b0c7d8a4175dcc04425c /common
parent6bedfaaeea210c90514784ae66a16e3a4bc878ed (diff)
downloadbuild_soong-b05bff2f26fd0c1fbc4f31e66e0dcfc4ab883f7e.tar.gz
build_soong-b05bff2f26fd0c1fbc4f31e66e0dcfc4ab883f7e.tar.bz2
build_soong-b05bff2f26fd0c1fbc4f31e66e0dcfc4ab883f7e.zip
Add per target archtecture properties
At least libcutils and boringssl need to set source files that apply to x86 or x86_64, but only on the host or on the device. Add new properties that can contain arch variant properties: target.android_arm target.android_arm64 target.android_mips target.android_mips64 target.android_x86 target.android_x86_64 target.linux_x86 target.linux_x86_64 target.darwin_x86 target.darwin_x86_64 Change-Id: I5a7076653a7367a63daa7f7e34a6a28f5cbdfbe7
Diffstat (limited to 'common')
-rw-r--r--common/arch.go69
1 files changed, 52 insertions, 17 deletions
diff --git a/common/arch.go b/common/arch.go
index d4c17cf0..38613a06 100644
--- a/common/arch.go
+++ b/common/arch.go
@@ -106,14 +106,24 @@ type archProperties struct {
Lib64 interface{}
}
Target struct {
- Host interface{}
- Android interface{}
- Android64 interface{}
- Android32 interface{}
- Linux interface{}
- Darwin interface{}
- Windows interface{}
- Not_windows interface{}
+ Host interface{}
+ Android interface{}
+ Android_arm interface{}
+ Android_arm64 interface{}
+ Android_mips interface{}
+ Android_mips64 interface{}
+ Android_x86 interface{}
+ Android_x86_64 interface{}
+ Android64 interface{}
+ Android32 interface{}
+ Linux interface{}
+ Linux_x86 interface{}
+ Linux_x86_64 interface{}
+ Darwin interface{}
+ Darwin_x86 interface{}
+ Darwin_x86_64 interface{}
+ Windows interface{}
+ Not_windows interface{}
}
}
@@ -372,8 +382,8 @@ func (a *AndroidModuleBase) setArchProperties(ctx blueprint.EarlyMutatorContext,
generalPropsValue := reflect.ValueOf(a.generalProperties[i]).Elem()
// Handle arch-specific properties in the form:
- // arch {
- // arm64 {
+ // arch: {
+ // arm64: {
// key: value,
// },
// },
@@ -382,8 +392,8 @@ func (a *AndroidModuleBase) setArchProperties(ctx blueprint.EarlyMutatorContext,
reflect.ValueOf(a.archProperties[i].Arch).FieldByName(t.Field).Elem().Elem())
// Handle multilib-specific properties in the form:
- // multilib {
- // lib32 {
+ // multilib: {
+ // lib32: {
// key: value,
// },
// },
@@ -391,8 +401,8 @@ func (a *AndroidModuleBase) setArchProperties(ctx blueprint.EarlyMutatorContext,
reflect.ValueOf(a.archProperties[i].Multilib).FieldByName(t.MultilibField).Elem().Elem())
// Handle host-or-device-specific properties in the form:
- // target {
- // host {
+ // target: {
+ // host: {
// key: value,
// },
// },
@@ -401,11 +411,17 @@ func (a *AndroidModuleBase) setArchProperties(ctx blueprint.EarlyMutatorContext,
reflect.ValueOf(a.archProperties[i].Target).FieldByName(hod.Field()).Elem().Elem())
// Handle host target properties in the form:
- // target {
- // linux {
+ // target: {
+ // linux: {
+ // key: value,
+ // },
+ // not_windows: {
// key: value,
// },
- // not_windows {
+ // linux_x86: {
+ // key: value,
+ // },
+ // linux_arm: {
// key: value,
// },
// },
@@ -423,6 +439,9 @@ func (a *AndroidModuleBase) setArchProperties(ctx blueprint.EarlyMutatorContext,
if v.goos == runtime.GOOS {
a.extendProperties(ctx, "target", v.goos, generalPropsValue,
reflect.ValueOf(a.archProperties[i].Target).FieldByName(v.field).Elem().Elem())
+ t := arch.ArchType
+ a.extendProperties(ctx, "target", v.goos+"_"+t.Name, generalPropsValue,
+ reflect.ValueOf(a.archProperties[i].Target).FieldByName(v.field+"_"+t.Name).Elem().Elem())
}
}
a.extendProperties(ctx, "target", "not_windows", generalPropsValue,
@@ -451,6 +470,22 @@ func (a *AndroidModuleBase) setArchProperties(ctx blueprint.EarlyMutatorContext,
reflect.ValueOf(a.archProperties[i].Target).FieldByName("Android32").Elem().Elem())
}
}
+
+ // Handle device architecture properties in the form:
+ // target {
+ // android_arm {
+ // key: value,
+ // },
+ // android_x86 {
+ // key: value,
+ // },
+ // },
+ if hod.Device() {
+ t := arch.ArchType
+ a.extendProperties(ctx, "target", "android_"+t.Name, generalPropsValue,
+ reflect.ValueOf(a.archProperties[i].Target).FieldByName("Android_"+t.Name).Elem().Elem())
+ }
+
if ctx.Failed() {
return
}