Merge "Consolidate conversions of is-board-platform(2)" am: 35f94eba51
am: e42453740a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1941101 Change-Id: I1de90cc99db9f67188ce2eacd523bb77f57abde7
This commit is contained in:
commit
2f2ec9f018
2 changed files with 4 additions and 30 deletions
|
@ -91,9 +91,9 @@ var knownFunctions = map[string]interface {
|
|||
"foreach": &foreachCallPaser{},
|
||||
"if": &ifCallParser{},
|
||||
"info": &makeControlFuncParser{name: baseName + ".mkinfo"},
|
||||
"is-board-platform": &isBoardPlatformCallParser{},
|
||||
"is-board-platform": &simpleCallParser{name: baseName + ".board_platform_is", returnType: starlarkTypeBool, addGlobals: true},
|
||||
"is-board-platform2": &simpleCallParser{name: baseName + ".board_platform_is", returnType: starlarkTypeBool, addGlobals: true},
|
||||
"is-board-platform-in-list": &isBoardPlatformInListCallParser{},
|
||||
"is-board-platform-in-list": &simpleCallParser{name: baseName + ".board_platform_in", returnType: starlarkTypeBool, addGlobals: true},
|
||||
"is-board-platform-in-list2": &simpleCallParser{name: baseName + ".board_platform_in", returnType: starlarkTypeBool, addGlobals: true},
|
||||
"is-product-in-list": &isProductInListCallParser{},
|
||||
"is-vendor-board-platform": &isVendorBoardPlatformCallParser{},
|
||||
|
@ -1439,32 +1439,6 @@ func (p *myDirCallParser) parse(ctx *parseContext, node mkparser.Node, args *mkp
|
|||
return &variableRefExpr{ctx.addVariable("LOCAL_PATH"), true}
|
||||
}
|
||||
|
||||
type isBoardPlatformCallParser struct{}
|
||||
|
||||
func (p *isBoardPlatformCallParser) parse(ctx *parseContext, node mkparser.Node, args *mkparser.MakeString) starlarkExpr {
|
||||
if args.Empty() {
|
||||
return ctx.newBadExpr(node, "is-board-platform requires an argument")
|
||||
}
|
||||
return &eqExpr{
|
||||
left: &variableRefExpr{ctx.addVariable("TARGET_BOARD_PLATFORM"), false},
|
||||
right: ctx.parseMakeString(node, args),
|
||||
isEq: true,
|
||||
}
|
||||
}
|
||||
|
||||
type isBoardPlatformInListCallParser struct{}
|
||||
|
||||
func (p *isBoardPlatformInListCallParser) parse(ctx *parseContext, node mkparser.Node, args *mkparser.MakeString) starlarkExpr {
|
||||
if args.Empty() {
|
||||
return ctx.newBadExpr(node, "is-board-platform-in-list requires an argument")
|
||||
}
|
||||
return &inExpr{
|
||||
expr: &variableRefExpr{ctx.addVariable("TARGET_BOARD_PLATFORM"), false},
|
||||
list: maybeConvertToStringList(ctx.parseMakeString(node, args)),
|
||||
isNot: false,
|
||||
}
|
||||
}
|
||||
|
||||
type isProductInListCallParser struct{}
|
||||
|
||||
func (p *isProductInListCallParser) parse(ctx *parseContext, node mkparser.Node, args *mkparser.MakeString) starlarkExpr {
|
||||
|
|
|
@ -598,9 +598,9 @@ endif
|
|||
|
||||
def init(g, handle):
|
||||
cfg = rblf.cfg(handle)
|
||||
if g.get("TARGET_BOARD_PLATFORM", "") in ["msm8998"]:
|
||||
if rblf.board_platform_in(g, "msm8998"):
|
||||
pass
|
||||
elif g.get("TARGET_BOARD_PLATFORM", "") != "copper":
|
||||
elif not rblf.board_platform_is(g, "copper"):
|
||||
pass
|
||||
elif g.get("TARGET_BOARD_PLATFORM", "") not in g["QCOM_BOARD_PLATFORMS"]:
|
||||
pass
|
||||
|
|
Loading…
Reference in a new issue