Support sdk_version: "current"
for the NDK. am: ebedf678de
am: f17634d777
am: 9ce4703a8e
Change-Id: I360fbb7e080269e8ff35577dc4cb6c69f200ffbe
This commit is contained in:
commit
3a31674e7b
3 changed files with 28 additions and 7 deletions
17
cc/binary.go
17
cc/binary.go
|
@ -101,15 +101,24 @@ func (binary *binaryDecorator) linkerDeps(ctx BaseModuleContext, deps Deps) Deps
|
|||
}
|
||||
deps.CrtEnd = "crtend_android"
|
||||
} else {
|
||||
// TODO(danalbert): Add generation of crt objects.
|
||||
// For `sdk_version: "current"`, we don't actually have a
|
||||
// freshly generated set of CRT objects. Use the last stable
|
||||
// version.
|
||||
version := ctx.sdkVersion()
|
||||
if version == "current" {
|
||||
version = ctx.AConfig().PlatformSdkVersion()
|
||||
}
|
||||
|
||||
if binary.static() {
|
||||
deps.CrtBegin = "ndk_crtbegin_static." + ctx.sdkVersion()
|
||||
deps.CrtBegin = "ndk_crtbegin_static." + version
|
||||
} else {
|
||||
if binary.static() {
|
||||
deps.CrtBegin = "ndk_crtbegin_static." + ctx.sdkVersion()
|
||||
deps.CrtBegin = "ndk_crtbegin_static." + version
|
||||
} else {
|
||||
deps.CrtBegin = "ndk_crtbegin_dynamic." + ctx.sdkVersion()
|
||||
deps.CrtBegin = "ndk_crtbegin_dynamic." + version
|
||||
}
|
||||
deps.CrtEnd = "ndk_crtend_android." + ctx.sdkVersion()
|
||||
deps.CrtEnd = "ndk_crtend_android." + version
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -183,8 +183,12 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags) Flag
|
|||
// Traditionally this has come from android/api-level.h, but with the
|
||||
// libc headers unified it must be set by the build system since we
|
||||
// don't have per-API level copies of that header now.
|
||||
version := ctx.sdkVersion()
|
||||
if version == "current" {
|
||||
version = "__ANDROID_API_FUTURE__"
|
||||
}
|
||||
flags.GlobalFlags = append(flags.GlobalFlags,
|
||||
"-D__ANDROID_API__="+ctx.sdkVersion())
|
||||
"-D__ANDROID_API__="+version)
|
||||
|
||||
// Until the full NDK has been migrated to using ndk_headers, we still
|
||||
// need to add the legacy sysroot includes to get the full set of
|
||||
|
|
|
@ -335,8 +335,16 @@ func (library *libraryDecorator) linkerDeps(ctx BaseModuleContext, deps Deps) De
|
|||
deps.CrtBegin = "crtbegin_so"
|
||||
deps.CrtEnd = "crtend_so"
|
||||
} else {
|
||||
deps.CrtBegin = "ndk_crtbegin_so." + ctx.sdkVersion()
|
||||
deps.CrtEnd = "ndk_crtend_so." + ctx.sdkVersion()
|
||||
// TODO(danalbert): Add generation of crt objects.
|
||||
// For `sdk_version: "current"`, we don't actually have a
|
||||
// freshly generated set of CRT objects. Use the last stable
|
||||
// version.
|
||||
version := ctx.sdkVersion()
|
||||
if version == "current" {
|
||||
version = ctx.AConfig().PlatformSdkVersion()
|
||||
}
|
||||
deps.CrtBegin = "ndk_crtbegin_so." + version
|
||||
deps.CrtEnd = "ndk_crtend_so." + version
|
||||
}
|
||||
}
|
||||
deps.WholeStaticLibs = append(deps.WholeStaticLibs, library.Properties.Shared.Whole_static_libs...)
|
||||
|
|
Loading…
Reference in a new issue