Merge changes from topic "update-prebuilts-r18b"
am: f9e2c3f5d7
Change-Id: Ie4722fb5971ddff0c1a1acf11eda464ca4f01916
This commit is contained in:
23
cc/stl.go
23
cc/stl.go
@@ -17,6 +17,7 @@ package cc
|
|||||||
import (
|
import (
|
||||||
"android/soong/android"
|
"android/soong/android"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
func getNdkStlFamily(m *Module) string {
|
func getNdkStlFamily(m *Module) string {
|
||||||
@@ -110,6 +111,26 @@ func (stl *stl) begin(ctx BaseModuleContext) {
|
|||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func needsLibAndroidSupport(ctx BaseModuleContext) bool {
|
||||||
|
versionStr, err := normalizeNdkApiLevel(ctx, ctx.sdkVersion(), ctx.Arch())
|
||||||
|
if err != nil {
|
||||||
|
ctx.PropertyErrorf("sdk_version", err.Error())
|
||||||
|
}
|
||||||
|
|
||||||
|
if versionStr == "current" {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
version, err := strconv.Atoi(versionStr)
|
||||||
|
if err != nil {
|
||||||
|
panic(fmt.Sprintf(
|
||||||
|
"invalid API level returned from normalizeNdkApiLevel: %q",
|
||||||
|
versionStr))
|
||||||
|
}
|
||||||
|
|
||||||
|
return version < 21
|
||||||
|
}
|
||||||
|
|
||||||
func (stl *stl) deps(ctx BaseModuleContext, deps Deps) Deps {
|
func (stl *stl) deps(ctx BaseModuleContext, deps Deps) Deps {
|
||||||
switch stl.Properties.SelectedStl {
|
switch stl.Properties.SelectedStl {
|
||||||
case "libstdc++":
|
case "libstdc++":
|
||||||
@@ -141,7 +162,9 @@ func (stl *stl) deps(ctx BaseModuleContext, deps Deps) Deps {
|
|||||||
} else {
|
} else {
|
||||||
deps.StaticLibs = append(deps.StaticLibs, stl.Properties.SelectedStl, "ndk_libc++abi")
|
deps.StaticLibs = append(deps.StaticLibs, stl.Properties.SelectedStl, "ndk_libc++abi")
|
||||||
}
|
}
|
||||||
|
if needsLibAndroidSupport(ctx) {
|
||||||
deps.StaticLibs = append(deps.StaticLibs, "ndk_libandroid_support")
|
deps.StaticLibs = append(deps.StaticLibs, "ndk_libandroid_support")
|
||||||
|
}
|
||||||
if ctx.Arch().ArchType == android.Arm {
|
if ctx.Arch().ArchType == android.Arm {
|
||||||
deps.StaticLibs = append(deps.StaticLibs, "ndk_libunwind")
|
deps.StaticLibs = append(deps.StaticLibs, "ndk_libunwind")
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user