Add basic NDK STL link type check.
Test: make native
Bug: None
Change-Id: If883fade38c837839857d82f294c459b0dae1ce0
diff --git a/cc/stl.go b/cc/stl.go
index 347db99..338db84 100644
--- a/cc/stl.go
+++ b/cc/stl.go
@@ -19,6 +19,25 @@
"fmt"
)
+func getNdkStlFamily(ctx android.ModuleContext, m *Module) string {
+ stl := m.stl.Properties.SelectedStl
+ switch stl {
+ case "ndk_libc++_shared", "ndk_libc++_static":
+ return "libc++"
+ case "ndk_libstlport_shared", "ndk_libstlport_static":
+ return "stlport"
+ case "ndk_libgnustl_static":
+ return "gnustl"
+ case "ndk_system":
+ return "system"
+ case "":
+ return "none"
+ default:
+ ctx.ModuleErrorf("stl: %q is not a valid STL", stl)
+ return ""
+ }
+}
+
type StlProperties struct {
// select the STL library to use. Possible values are "libc++", "libc++_static",
// "stlport", "stlport_static", "ndk", "libstdc++", or "none". Leave blank to select the