Loading android/config.go +1 −1 Original line number Diff line number Diff line Loading @@ -482,7 +482,7 @@ func (c *config) PlatformSdkCodename() string { } func (c *config) MinSupportedSdkVersion() int { return 14 return 16 } func (c *config) DefaultAppTargetSdkInt() int { Loading cc/compiler.go +2 −8 Original line number Diff line number Diff line Loading @@ -299,6 +299,7 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps } if ctx.useSdk() { // TODO: Switch to --sysroot. // The NDK headers are installed to a common sysroot. While a more // typical Soong approach would be to only make the headers for the // library you're using available, we're trying to emulate the NDK Loading @@ -307,6 +308,7 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps "-isystem "+getCurrentIncludePath(ctx).String(), "-isystem "+getCurrentIncludePath(ctx).Join(ctx, config.NDKTriple(tc)).String()) // TODO: Migrate to API suffixed triple? // 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. Loading @@ -316,14 +318,6 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps } flags.GlobalFlags = append(flags.GlobalFlags, "-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 // headers. legacyIncludes := fmt.Sprintf( "prebuilts/ndk/current/platforms/android-%s/arch-%s/usr/include", ctx.sdkVersion(), ctx.Arch().ArchType.String()) flags.SystemIncludeFlags = append(flags.SystemIncludeFlags, "-isystem "+legacyIncludes) } if ctx.useVndk() { Loading cc/stl.go +24 −1 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package cc import ( "android/soong/android" "fmt" "strconv" ) func getNdkStlFamily(m *Module) string { Loading Loading @@ -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 { switch stl.Properties.SelectedStl { case "libstdc++": Loading Loading @@ -141,7 +162,9 @@ func (stl *stl) deps(ctx BaseModuleContext, deps Deps) Deps { } else { deps.StaticLibs = append(deps.StaticLibs, stl.Properties.SelectedStl, "ndk_libc++abi") } if needsLibAndroidSupport(ctx) { deps.StaticLibs = append(deps.StaticLibs, "ndk_libandroid_support") } if ctx.Arch().ArchType == android.Arm { deps.StaticLibs = append(deps.StaticLibs, "ndk_libunwind") } Loading Loading
android/config.go +1 −1 Original line number Diff line number Diff line Loading @@ -482,7 +482,7 @@ func (c *config) PlatformSdkCodename() string { } func (c *config) MinSupportedSdkVersion() int { return 14 return 16 } func (c *config) DefaultAppTargetSdkInt() int { Loading
cc/compiler.go +2 −8 Original line number Diff line number Diff line Loading @@ -299,6 +299,7 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps } if ctx.useSdk() { // TODO: Switch to --sysroot. // The NDK headers are installed to a common sysroot. While a more // typical Soong approach would be to only make the headers for the // library you're using available, we're trying to emulate the NDK Loading @@ -307,6 +308,7 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps "-isystem "+getCurrentIncludePath(ctx).String(), "-isystem "+getCurrentIncludePath(ctx).Join(ctx, config.NDKTriple(tc)).String()) // TODO: Migrate to API suffixed triple? // 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. Loading @@ -316,14 +318,6 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps } flags.GlobalFlags = append(flags.GlobalFlags, "-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 // headers. legacyIncludes := fmt.Sprintf( "prebuilts/ndk/current/platforms/android-%s/arch-%s/usr/include", ctx.sdkVersion(), ctx.Arch().ArchType.String()) flags.SystemIncludeFlags = append(flags.SystemIncludeFlags, "-isystem "+legacyIncludes) } if ctx.useVndk() { Loading
cc/stl.go +24 −1 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package cc import ( "android/soong/android" "fmt" "strconv" ) func getNdkStlFamily(m *Module) string { Loading Loading @@ -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 { switch stl.Properties.SelectedStl { case "libstdc++": Loading Loading @@ -141,7 +162,9 @@ func (stl *stl) deps(ctx BaseModuleContext, deps Deps) Deps { } else { deps.StaticLibs = append(deps.StaticLibs, stl.Properties.SelectedStl, "ndk_libc++abi") } if needsLibAndroidSupport(ctx) { deps.StaticLibs = append(deps.StaticLibs, "ndk_libandroid_support") } if ctx.Arch().ArchType == android.Arm { deps.StaticLibs = append(deps.StaticLibs, "ndk_libunwind") } Loading