Make Stl *bool

am: 7924885eb3

Change-Id: Icf730927c66d287ee69c1bdaae9244e5203a2033
This commit is contained in:
Colin Cross
2016-07-12 21:42:53 +00:00
committed by android-build-merger

View File

@@ -23,7 +23,7 @@ type StlProperties struct {
// select the STL library to use. Possible values are "libc++", "libc++_static", // select the STL library to use. Possible values are "libc++", "libc++_static",
// "stlport", "stlport_static", "ndk", "libstdc++", or "none". Leave blank to select the // "stlport", "stlport_static", "ndk", "libstdc++", or "none". Leave blank to select the
// default // default
Stl string Stl *string
SelectedStl string `blueprint:"mutated"` SelectedStl string `blueprint:"mutated"`
} }
@@ -38,35 +38,39 @@ func (stl *stl) props() []interface{} {
func (stl *stl) begin(ctx BaseModuleContext) { func (stl *stl) begin(ctx BaseModuleContext) {
stl.Properties.SelectedStl = func() string { stl.Properties.SelectedStl = func() string {
s := ""
if stl.Properties.Stl != nil {
s = *stl.Properties.Stl
}
if ctx.sdk() && ctx.Device() { if ctx.sdk() && ctx.Device() {
switch stl.Properties.Stl { switch s {
case "": case "":
return "ndk_system" return "ndk_system"
case "c++_shared", "c++_static", case "c++_shared", "c++_static",
"stlport_shared", "stlport_static", "stlport_shared", "stlport_static",
"gnustl_static": "gnustl_static":
return "ndk_lib" + stl.Properties.Stl return "ndk_lib" + s
case "none": case "none":
return "" return ""
default: default:
ctx.ModuleErrorf("stl: %q is not a supported STL with sdk_version set", stl.Properties.Stl) ctx.ModuleErrorf("stl: %q is not a supported STL with sdk_version set", s)
return "" return ""
} }
} else if ctx.Os() == android.Windows { } else if ctx.Os() == android.Windows {
switch stl.Properties.Stl { switch s {
case "libc++", "libc++_static", "libstdc++", "": case "libc++", "libc++_static", "libstdc++", "":
// libc++ is not supported on mingw // libc++ is not supported on mingw
return "libstdc++" return "libstdc++"
case "none": case "none":
return "" return ""
default: default:
ctx.ModuleErrorf("stl: %q is not a supported STL for windows", stl.Properties.Stl) ctx.ModuleErrorf("stl: %q is not a supported STL for windows", s)
return "" return ""
} }
} else { } else {
switch stl.Properties.Stl { switch s {
case "libc++", "libc++_static": case "libc++", "libc++_static":
return stl.Properties.Stl return s
case "none": case "none":
return "" return ""
case "": case "":
@@ -76,7 +80,7 @@ func (stl *stl) begin(ctx BaseModuleContext) {
return "libc++" return "libc++"
} }
default: default:
ctx.ModuleErrorf("stl: %q is not a supported STL", stl.Properties.Stl) ctx.ModuleErrorf("stl: %q is not a supported STL", s)
return "" return ""
} }
} }