more cross-arch build.ps1 android fixes

This commit is contained in:
Alex Lorenz
2024-05-14 12:14:08 -07:00
parent 7815f843a3
commit 5905dc9ef3
3 changed files with 52 additions and 4 deletions

View File

@@ -0,0 +1,24 @@
set(SWIFT_HOST_VARIANT_SDK ANDROID CACHE STRING "")
set(SWIFT_HOST_VARIANT_ARCH i686 CACHE STRING "")
# NOTE(compnerd) disable the tools, we are trying to build just the standard
# library.
set(SWIFT_INCLUDE_TOOLS NO CACHE BOOL "")
# NOTE(compnerd) cannot build tests since the tests require the toolchain
set(SWIFT_INCLUDE_TESTS NO CACHE BOOL "")
# NOTE(compnerd) cannot build docs since that requires perl
set(SWIFT_INCLUDE_DOCS NO CACHE BOOL "")
# NOTE(compnerd) these are part of the toolchain, not the runtime.
set(SWIFT_BUILD_SOURCEKIT NO CACHE BOOL "")
# NOTE(compnerd) build with the compiler specified, not a just built compiler.
set(SWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER YES CACHE BOOL "")
set(SWIFT_SDK_ANDROID_ARCHITECTURES i686 CACHE STRING "")
# NOTE(compnerd) this is lollipop, which seems to still have decent usage.
set(SWIFT_ANDROID_API_LEVEL 21 CACHE STRING "")

View File

@@ -0,0 +1,24 @@
set(SWIFT_HOST_VARIANT_SDK ANDROID CACHE STRING "")
set(SWIFT_HOST_VARIANT_ARCH x86_64 CACHE STRING "")
# NOTE(compnerd) disable the tools, we are trying to build just the standard
# library.
set(SWIFT_INCLUDE_TOOLS NO CACHE BOOL "")
# NOTE(compnerd) cannot build tests since the tests require the toolchain
set(SWIFT_INCLUDE_TESTS NO CACHE BOOL "")
# NOTE(compnerd) cannot build docs since that requires perl
set(SWIFT_INCLUDE_DOCS NO CACHE BOOL "")
# NOTE(compnerd) these are part of the toolchain, not the runtime.
set(SWIFT_BUILD_SOURCEKIT NO CACHE BOOL "")
# NOTE(compnerd) build with the compiler specified, not a just built compiler.
set(SWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER YES CACHE BOOL "")
set(SWIFT_SDK_ANDROID_ARCHITECTURES x86_64 CACHE STRING "")
# NOTE(compnerd) this is lollipop, which seems to still have decent usage.
set(SWIFT_ANDROID_API_LEVEL 21 CACHE STRING "")

View File

@@ -250,7 +250,7 @@ $AndroidARMv7 = @{
BinaryDir = "bina";
CMakeName = "armv7-a";
LLVMName = "armv7";
LLVMTarget = "armv7a-unknown-linux-androideabi";
LLVMTarget = "armv7-unknown-linux-androideabi$AndroidAPILevel";
BuildID = 500;
BinaryCache = "$BinaryCache\armv7";
PlatformInstallRoot = "$BinaryCache\armv7\Android.platform";
@@ -263,7 +263,7 @@ $AndroidX86 = @{
BinaryDir = "bin";
CMakeName = "i686";
LLVMName = "i686";
LLVMTarget = "i686-unknown-linux-android";
LLVMTarget = "i686-unknown-linux-android$AndroidAPILevel";
BuildID = 600;
BinaryCache = "$BinaryCache\i686";
PlatformInstallRoot = "$BinaryCache\x86\Android.platform";
@@ -276,7 +276,7 @@ $AndroidX64 = @{
BinaryDir = "bin64";
CMakeName = "x86_64";
LLVMName = "x86_64";
LLVMTarget = "x86_64-unknown-linux-android";
LLVMTarget = "x86_64-unknown-linux-android$AndroidAPILevel";
BuildID = 700;
BinaryCache = "$BinaryCache\x86_64";
PlatformInstallRoot = "$BinaryCache\x64\Android.platform";
@@ -1630,7 +1630,7 @@ function Build-Foundation([Platform]$Platform, $Arch, [switch]$Test = $false) {
-UseBuiltCompilers ASM,C,Swift `
-BuildTargets $Targets `
-Defines (@{
BUILD_TOOLS = if ($Platform -eq "Windows") { "YES" } else { "NO" };
FOUNDATION_BUILD_TOOLS = if ($Platform -eq "Windows") { "YES" } else { "NO" };
CMAKE_SYSTEM_NAME = $Platform.ToString();
# Turn off safeseh for lld as it has safeseh enabled by default
# and fails with an ICU data object file icudt69l_dat.obj. This