Make androidmk translate LOCAL_32_BIT_ONLY

Translate LOCAL_32_BIT_ONLY := true to compile_multilib: "32".

Test: androidmk frameworks/av/services/mediadrm/Android.mk
Change-Id: I9f73f5fdfc67738286844ff42b39ee54403fe649
This commit is contained in:
Anton Hansson 2019-01-08 15:39:37 +00:00
parent 1f8076b42d
commit 1976a25692
1 changed files with 15 additions and 0 deletions

View File

@ -42,6 +42,7 @@ type variableAssignmentContext struct {
var rewriteProperties = map[string](func(variableAssignmentContext) error){
// custom functions
"LOCAL_32_BIT_ONLY": local32BitOnly,
"LOCAL_AIDL_INCLUDES": localAidlIncludes,
"LOCAL_C_INCLUDES": localIncludeDirs,
"LOCAL_EXPORT_C_INCLUDE_DIRS": exportIncludeDirs,
@ -360,6 +361,20 @@ func exportIncludeDirs(ctx variableAssignmentContext) error {
return splitAndAssign(ctx, classifyLocalOrGlobalPath, map[string]string{"global": "export_include_dirs", "local": "export_include_dirs"})
}
func local32BitOnly(ctx variableAssignmentContext) error {
val, err := makeVariableToBlueprint(ctx.file, ctx.mkvalue, bpparser.BoolType)
if err != nil {
return err
}
if val.(*bpparser.Bool).Value {
thirtyTwo := &bpparser.String{
Value: "32",
}
setVariable(ctx.file, false, ctx.prefix, "compile_multilib", thirtyTwo, true)
}
return nil
}
func localAidlIncludes(ctx variableAssignmentContext) error {
return splitAndAssign(ctx, classifyLocalOrGlobalPath, map[string]string{"global": "aidl.include_dirs", "local": "aidl.local_include_dirs"})
}