Merge "Convert preview sdkVersion to int for target-api" into main
This commit is contained in:
11
cc/rs.go
11
cc/rs.go
@@ -101,11 +101,12 @@ func rsGenerateCpp(ctx android.ModuleContext, rsFiles android.Paths, rsFlags str
|
|||||||
func rsFlags(ctx ModuleContext, flags Flags, properties *BaseCompilerProperties) Flags {
|
func rsFlags(ctx ModuleContext, flags Flags, properties *BaseCompilerProperties) Flags {
|
||||||
targetApi := String(properties.Renderscript.Target_api)
|
targetApi := String(properties.Renderscript.Target_api)
|
||||||
if targetApi == "" && ctx.useSdk() {
|
if targetApi == "" && ctx.useSdk() {
|
||||||
switch ctx.sdkVersion() {
|
targetApiLevel := android.ApiLevelOrPanic(ctx, ctx.sdkVersion())
|
||||||
case "current", "system_current", "test_current":
|
if targetApiLevel.IsCurrent() || targetApiLevel.IsPreview() {
|
||||||
// Nothing
|
// If the target level is current or preview, leave the 'target-api' unset.
|
||||||
default:
|
// This signals to llvm-rs-cc that the development API should be used.
|
||||||
targetApi = android.GetNumericSdkVersion(ctx.sdkVersion())
|
} else {
|
||||||
|
targetApi = targetApiLevel.String()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user