Support prepended arch-specific properties am: 6ee75b61cd am: 200aa27c86

am: 1a0f0c01a3

* commit '1a0f0c01a330c9ce1a0ca5a00b09c126850da497':
  Support prepended arch-specific properties

Change-Id: I1604797db31fbd895ba9a3bab80c157474e0ce12
This commit is contained in:
Colin Cross
2016-05-06 01:14:23 +00:00
committed by android-build-merger
2 changed files with 13 additions and 3 deletions

View File

@@ -306,10 +306,10 @@ type BaseLinkerProperties struct {
// in their entirety. For static library modules, all of the .o files from the intermediate
// directory of the dependency will be linked into this modules .a file. For a shared library,
// the dependency's .a file will be linked into this module using -Wl,--whole-archive.
Whole_static_libs []string `android:"arch_variant"`
Whole_static_libs []string `android:"arch_variant,variant_prepend"`
// list of modules that should be statically linked into this module.
Static_libs []string `android:"arch_variant"`
Static_libs []string `android:"arch_variant,variant_prepend"`
// list of modules that should be dynamically linked into this module.
Shared_libs []string `android:"arch_variant"`

View File

@@ -621,7 +621,17 @@ func (a *AndroidModuleBase) appendProperties(ctx AndroidBottomUpMutatorContext,
return true, nil
}
err := proptools.AppendProperties(dst, src, filter)
order := func(property string,
dstField, srcField reflect.StructField,
dstValue, srcValue interface{}) (proptools.Order, error) {
if proptools.HasTag(dstField, "android", "variant_prepend") {
return proptools.Prepend, nil
} else {
return proptools.Append, nil
}
}
err := proptools.ExtendProperties(dst, src, filter, order)
if err != nil {
if propertyErr, ok := err.(*proptools.ExtendPropertyError); ok {
ctx.PropertyErrorf(propertyErr.Property, "%s", propertyErr.Err.Error())