From e2c865bffc256d8b85508f12fb78e981b3db30bd Mon Sep 17 00:00:00 2001 From: Eric Date: Wed, 21 Jun 2023 02:43:31 +0800 Subject: [PATCH 1/3] [Docs][Android] Fix minimal Android API level --- docs/Android.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Android.md b/docs/Android.md index af15d57d2dddf..ab498db2eabc0 100644 --- a/docs/Android.md +++ b/docs/Android.md @@ -62,7 +62,7 @@ $ utils/build-script \ --android \ # Build for Android. --android-ndk $NDK_PATH \ # Path to an Android NDK. --android-arch aarch64 \ # Optionally specify Android architecture, alternately armv7 or x86_64 - --android-api-level 21 \ # The Android API level to target. Swift only supports 21 or greater. + --android-api-level 23 \ # The Android API level to target. Swift only supports 21 or greater. --stdlib-deployment-targets=android-aarch64 \ # Only cross-compile the stdlib for Android, ie don't build the native stdlib for Linux --native-swift-tools-path=$SWIFT_PATH \ # Path to your prebuilt Swift compiler --native-clang-tools-path=$SWIFT_PATH \ # Path to a prebuilt clang compiler, one comes with the Swift toolchain From 23369bbd8e84b1e4d0c1c0165947da8f14e90490 Mon Sep 17 00:00:00 2001 From: eki Date: Fri, 23 Jun 2023 02:13:42 +0800 Subject: [PATCH 2/3] [Docs][Android] Fix android minimal api level to 23 --- docs/Android.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/Android.md b/docs/Android.md index ab498db2eabc0..8b5403bd3d971 100644 --- a/docs/Android.md +++ b/docs/Android.md @@ -62,7 +62,7 @@ $ utils/build-script \ --android \ # Build for Android. --android-ndk $NDK_PATH \ # Path to an Android NDK. --android-arch aarch64 \ # Optionally specify Android architecture, alternately armv7 or x86_64 - --android-api-level 23 \ # The Android API level to target. Swift only supports 21 or greater. + --android-api-level 23 \ # The Android API level to target. Swift only supports 23 or greater. --stdlib-deployment-targets=android-aarch64 \ # Only cross-compile the stdlib for Android, ie don't build the native stdlib for Linux --native-swift-tools-path=$SWIFT_PATH \ # Path to your prebuilt Swift compiler --native-clang-tools-path=$SWIFT_PATH \ # Path to a prebuilt clang compiler, one comes with the Swift toolchain @@ -88,7 +88,7 @@ $ SWIFT_PATH=path/to/swift-DEVELOPMENT-SNAPSHOT-2022-05-31-a-ubuntu20.04/usr/bin $ $SWIFT_PATH/swiftc \ # The prebuilt Swift compiler you downloaded # The location of the tools used to build Android binaries -tools-directory ${NDK_PATH}/toolchains/llvm/prebuilt/linux-x86_64/bin/ \ - -target aarch64-unknown-linux-android21 \ # Targeting Android aarch64 at API 21 + -target aarch64-unknown-linux-android23 \ # Targeting Android aarch64 at API 23 -sdk ${NDK_PATH}/toolchains/llvm/prebuilt/linux-x86_64/sysroot \ # The SDK is the Android unified sysroot and the resource-dir is where you just built the Swift stdlib. -resource-dir build/Ninja-ReleaseAssert/swift-linux-x86_64/lib/swift hello.swift @@ -178,7 +178,7 @@ $ utils/build-script \ --android \ # Build for Android. --android-ndk ~/android-ndk-r25b \ # Path to an Android NDK. --android-arch aarch64 \ # Optionally specify Android architecture, alternately armv7 - --android-api-level 21 + --android-api-level 23 ``` This will build the Swift compiler and other host tools first, so expect a much From a04a3e2abfd5d62a44c2a99187920c8de3fb9b4e Mon Sep 17 00:00:00 2001 From: eki Date: Fri, 23 Jun 2023 02:15:29 +0800 Subject: [PATCH 3/3] [Build] Set android-api-level to 23 for android build --- utils/build-presets.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/build-presets.ini b/utils/build-presets.ini index a41f554a172d2..32b0b65db88ce 100644 --- a/utils/build-presets.ini +++ b/utils/build-presets.ini @@ -978,7 +978,7 @@ build-ninja android android-ndk=%(ndk_path)s -android-api-level=21 +android-api-level=23 build-swift-static-stdlib build-swift-static-sdk-overlay build-swift-stdlib-unittest-extra