Skip to content

Commit 5905dc9

Browse files
committed
more cross-arch build.ps1 android fixes
1 parent 7815f84 commit 5905dc9

File tree

3 files changed

+52
-4
lines changed

3 files changed

+52
-4
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
2+
set(SWIFT_HOST_VARIANT_SDK ANDROID CACHE STRING "")
3+
set(SWIFT_HOST_VARIANT_ARCH i686 CACHE STRING "")
4+
5+
# NOTE(compnerd) disable the tools, we are trying to build just the standard
6+
# library.
7+
set(SWIFT_INCLUDE_TOOLS NO CACHE BOOL "")
8+
9+
# NOTE(compnerd) cannot build tests since the tests require the toolchain
10+
set(SWIFT_INCLUDE_TESTS NO CACHE BOOL "")
11+
12+
# NOTE(compnerd) cannot build docs since that requires perl
13+
set(SWIFT_INCLUDE_DOCS NO CACHE BOOL "")
14+
15+
# NOTE(compnerd) these are part of the toolchain, not the runtime.
16+
set(SWIFT_BUILD_SOURCEKIT NO CACHE BOOL "")
17+
18+
# NOTE(compnerd) build with the compiler specified, not a just built compiler.
19+
set(SWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER YES CACHE BOOL "")
20+
21+
set(SWIFT_SDK_ANDROID_ARCHITECTURES i686 CACHE STRING "")
22+
23+
# NOTE(compnerd) this is lollipop, which seems to still have decent usage.
24+
set(SWIFT_ANDROID_API_LEVEL 21 CACHE STRING "")
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
2+
set(SWIFT_HOST_VARIANT_SDK ANDROID CACHE STRING "")
3+
set(SWIFT_HOST_VARIANT_ARCH x86_64 CACHE STRING "")
4+
5+
# NOTE(compnerd) disable the tools, we are trying to build just the standard
6+
# library.
7+
set(SWIFT_INCLUDE_TOOLS NO CACHE BOOL "")
8+
9+
# NOTE(compnerd) cannot build tests since the tests require the toolchain
10+
set(SWIFT_INCLUDE_TESTS NO CACHE BOOL "")
11+
12+
# NOTE(compnerd) cannot build docs since that requires perl
13+
set(SWIFT_INCLUDE_DOCS NO CACHE BOOL "")
14+
15+
# NOTE(compnerd) these are part of the toolchain, not the runtime.
16+
set(SWIFT_BUILD_SOURCEKIT NO CACHE BOOL "")
17+
18+
# NOTE(compnerd) build with the compiler specified, not a just built compiler.
19+
set(SWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER YES CACHE BOOL "")
20+
21+
set(SWIFT_SDK_ANDROID_ARCHITECTURES x86_64 CACHE STRING "")
22+
23+
# NOTE(compnerd) this is lollipop, which seems to still have decent usage.
24+
set(SWIFT_ANDROID_API_LEVEL 21 CACHE STRING "")

utils/build.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ $AndroidARMv7 = @{
250250
BinaryDir = "bina";
251251
CMakeName = "armv7-a";
252252
LLVMName = "armv7";
253-
LLVMTarget = "armv7a-unknown-linux-androideabi";
253+
LLVMTarget = "armv7-unknown-linux-androideabi$AndroidAPILevel";
254254
BuildID = 500;
255255
BinaryCache = "$BinaryCache\armv7";
256256
PlatformInstallRoot = "$BinaryCache\armv7\Android.platform";
@@ -263,7 +263,7 @@ $AndroidX86 = @{
263263
BinaryDir = "bin";
264264
CMakeName = "i686";
265265
LLVMName = "i686";
266-
LLVMTarget = "i686-unknown-linux-android";
266+
LLVMTarget = "i686-unknown-linux-android$AndroidAPILevel";
267267
BuildID = 600;
268268
BinaryCache = "$BinaryCache\i686";
269269
PlatformInstallRoot = "$BinaryCache\x86\Android.platform";
@@ -276,7 +276,7 @@ $AndroidX64 = @{
276276
BinaryDir = "bin64";
277277
CMakeName = "x86_64";
278278
LLVMName = "x86_64";
279-
LLVMTarget = "x86_64-unknown-linux-android";
279+
LLVMTarget = "x86_64-unknown-linux-android$AndroidAPILevel";
280280
BuildID = 700;
281281
BinaryCache = "$BinaryCache\x86_64";
282282
PlatformInstallRoot = "$BinaryCache\x64\Android.platform";
@@ -1630,7 +1630,7 @@ function Build-Foundation([Platform]$Platform, $Arch, [switch]$Test = $false) {
16301630
-UseBuiltCompilers ASM,C,Swift `
16311631
-BuildTargets $Targets `
16321632
-Defines (@{
1633-
BUILD_TOOLS = if ($Platform -eq "Windows") { "YES" } else { "NO" };
1633+
FOUNDATION_BUILD_TOOLS = if ($Platform -eq "Windows") { "YES" } else { "NO" };
16341634
CMAKE_SYSTEM_NAME = $Platform.ToString();
16351635
# Turn off safeseh for lld as it has safeseh enabled by default
16361636
# and fails with an ICU data object file icudt69l_dat.obj. This

0 commit comments

Comments
 (0)