Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1976a256 authored by Anton Hansson's avatar Anton Hansson
Browse files

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
parent 1f8076b4
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -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"})
}