diff options
-rw-r--r-- | androidmk/cmd/androidmk/androidmk.go | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/androidmk/cmd/androidmk/androidmk.go b/androidmk/cmd/androidmk/androidmk.go index 799b7586..294f32e1 100644 --- a/androidmk/cmd/androidmk/androidmk.go +++ b/androidmk/cmd/androidmk/androidmk.go @@ -236,24 +236,21 @@ func handleAssignment(file *bpFile, assignment mkparser.Assignment, c *condition } else if _, ok := deleteProperties[name]; ok { return } else { - if name == "LOCAL_PATH" { + switch { + case name == "LOCAL_PATH": // Nothing to do, except maybe avoid the "./" in paths? - } else if name == "LOCAL_ARM_MODE" { + case name == "LOCAL_ARM_MODE": // This is a hack to get the LOCAL_ARM_MODE value inside // of an arch: { arm: {} } block. armModeAssign := assignment armModeAssign.Name = mkparser.SimpleMakeString("LOCAL_ARM_MODE_HACK_arm", assignment.Name.Pos) handleAssignment(file, armModeAssign, c) - } else if strings.HasPrefix(name, "LOCAL_") { - //setVariable(file, assignment, name, bpparser.String, true) - switch name { - case "LOCAL_ADDITIONAL_DEPENDENCIES": - // TODO: check for only .mk files? - default: - file.errorf(assignment, "unsupported assignment to %s", name) - return - } - } else { + case name == "LOCAL_ADDITIONAL_DEPENDENCIES": + // TODO: check for only .mk files? + case strings.HasPrefix(name, "LOCAL_"): + file.errorf(assignment, "unsupported assignment to %s", name) + return + default: err = setVariable(file, assignment.Value, assignment.Type == "+=", name, bpparser.List, false, class, suffix) } } |