Work-around for crt objects with sdk: current
Test: convert libcups from Android.mk->Android.bp, mm -j64. Change-Id: I4fddcfa5806d0ce27a229c37a078b0d93e9082a8
This commit is contained in:
@@ -122,7 +122,7 @@ func (binary *binaryDecorator) linkerDeps(ctx DepsContext, deps Deps) Deps {
|
||||
// version.
|
||||
version := ctx.sdkVersion()
|
||||
if version == "current" {
|
||||
version = ctx.AConfig().PlatformSdkVersion()
|
||||
version = getCurrentNdkPrebuiltVersion(ctx)
|
||||
}
|
||||
|
||||
if binary.static() {
|
||||
|
7
cc/cc.go
7
cc/cc.go
@@ -1193,4 +1193,11 @@ func lastUniqueElements(list []string) []string {
|
||||
return list[totalSkip:]
|
||||
}
|
||||
|
||||
func getCurrentNdkPrebuiltVersion(ctx DepsContext) string {
|
||||
if ctx.AConfig().PlatformSdkVersionInt() > config.NdkMaxPrebuiltVersionInt {
|
||||
return strconv.Itoa(config.NdkMaxPrebuiltVersionInt)
|
||||
}
|
||||
return ctx.AConfig().PlatformSdkVersion()
|
||||
}
|
||||
|
||||
var Bool = proptools.Bool
|
||||
|
@@ -71,6 +71,8 @@ var (
|
||||
GccCppStdVersion = "gnu++11"
|
||||
ExperimentalCStdVersion = "gnu11"
|
||||
ExperimentalCppStdVersion = "gnu++1z"
|
||||
|
||||
NdkMaxPrebuiltVersionInt = 24
|
||||
)
|
||||
|
||||
var pctx = android.NewPackageContext("android/soong/cc/config")
|
||||
|
@@ -424,7 +424,7 @@ func (library *libraryDecorator) linkerDeps(ctx DepsContext, deps Deps) Deps {
|
||||
// version.
|
||||
version := ctx.sdkVersion()
|
||||
if version == "current" {
|
||||
version = ctx.AConfig().PlatformSdkVersion()
|
||||
version = getCurrentNdkPrebuiltVersion(ctx)
|
||||
}
|
||||
deps.CrtBegin = "ndk_crtbegin_so." + version
|
||||
deps.CrtEnd = "ndk_crtend_so." + version
|
||||
|
Reference in New Issue
Block a user