diff options
author | Colin Cross <ccross@android.com> | 2015-12-16 11:07:39 -0800 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2015-12-16 11:07:39 -0800 |
commit | a716addb5388810b11dc26a5165f00fdf7ba9513 (patch) | |
tree | fd9a5647e000ae28ad63c285215821288d064def /common | |
parent | 1ef47568f39b373533f4305662f561d3fa5f6527 (diff) | |
download | build_soong-a716addb5388810b11dc26a5165f00fdf7ba9513.tar.gz build_soong-a716addb5388810b11dc26a5165f00fdf7ba9513.tar.bz2 build_soong-a716addb5388810b11dc26a5165f00fdf7ba9513.zip |
Support "." in cpu and arch variant names
cortex-a53.a57 is a valid cpu variant, and needs to be translated to
cortex_a53_a57 when used as a field name. Replace
dashToUnderscoreReplacer with a replacer that also converts "." to "_".
Change-Id: I1c496249b50d8e3a8d2bd830bc890f43ad9ee29e
Diffstat (limited to 'common')
-rw-r--r-- | common/arch.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/common/arch.go b/common/arch.go index 37f7c38e..1d7d0de7 100644 --- a/common/arch.go +++ b/common/arch.go @@ -581,7 +581,7 @@ func InitArchModule(m AndroidModule, return m, allProperties } -var dashToUnderscoreReplacer = strings.NewReplacer("-", "_") +var variantReplacer = strings.NewReplacer("-", "_", ".", "_") func (a *AndroidModuleBase) appendProperties(ctx AndroidBottomUpMutatorContext, dst, src interface{}, field, srcPrefix string) interface{} { @@ -660,7 +660,7 @@ func (a *AndroidModuleBase) setArchProperties(ctx AndroidBottomUpMutatorContext) // key: value, // }, // }, - v := dashToUnderscoreReplacer.Replace(arch.ArchVariant) + v := variantReplacer.Replace(arch.ArchVariant) if v != "" { field := proptools.FieldNameForProperty(v) prefix := "arch." + t.Name + "." + v @@ -673,7 +673,7 @@ func (a *AndroidModuleBase) setArchProperties(ctx AndroidBottomUpMutatorContext) // key: value, // }, // }, - c := dashToUnderscoreReplacer.Replace(arch.CpuVariant) + c := variantReplacer.Replace(arch.CpuVariant) if c != "" { field := proptools.FieldNameForProperty(c) prefix := "arch." + t.Name + "." + c |