@@ -220,7 +220,7 @@ if ($AndroidSDKs.Length -gt 0) {
220
220
221
221
if ($Test -contains " *" ) {
222
222
# Explicitly don't include llbuild yet since tests are known to fail on Windows
223
- $Test = @ (" lld" , " lldb" , " swift" , " dispatch" , " foundation" , " xctest" , " swift-format" , " sourcekit-lsp" )
223
+ $Test = @ (" lld" , " lldb" , " swift" , " dispatch" , " foundation" , " xctest" , " swift-format" , " sourcekit-lsp" , " android " )
224
224
}
225
225
226
226
# Architecture definitions
@@ -2033,17 +2033,22 @@ function Build-CURL([Platform]$Platform, $Arch) {
2033
2033
})
2034
2034
}
2035
2035
2036
- function Build-Runtime ([Platform ]$Platform , $Arch ) {
2036
+ function Build-Runtime ([Platform ]$Platform , $Arch , [switch ]$Test = $false ) {
2037
+ $Targets = @ (" install" )
2037
2038
$PlatformDefines = @ {}
2038
2039
if ($Platform -eq " Android" ) {
2039
2040
$PlatformDefines += @ {
2040
2041
LLVM_ENABLE_LIBCXX = " YES" ;
2041
2042
SWIFT_USE_LINKER = " lld" ;
2042
- SWIFT_INCLUDE_TESTS = " NO" ;
2043
- SWIFT_INCLUDE_TEST_BINARIES = " NO" ;
2044
2043
}
2045
2044
}
2046
-
2045
+ if ($Test ) {
2046
+ $Targets += @ (" check-swift-all-only_non_executable" )
2047
+ $PlatformDefines += @ {
2048
+ SWIFT_INCLUDE_TESTS = " YES" ;
2049
+ SWIFT_BUILD_TEST_SUPPORT_MODULES = " YES" ;
2050
+ }
2051
+ }
2047
2052
2048
2053
Isolate- EnvVars {
2049
2054
$env: Path = " $ ( Get-CMarkBinaryCache $Arch ) \src;$ ( Get-PinnedToolchainRuntime ) ;${env: Path} "
@@ -2054,6 +2059,7 @@ function Build-Runtime([Platform]$Platform, $Arch) {
2054
2059
Get-HostProjectBinaryCache Compilers
2055
2060
}
2056
2061
2062
+ $NativeToolsPath = Join-Path - Path $CompilersBinaryCache - ChildPath " bin"
2057
2063
Build-CMakeProject `
2058
2064
- Src $SourceCache \swift `
2059
2065
- Bin (Get-TargetProjectBinaryCache $Arch Runtime) `
@@ -2062,6 +2068,7 @@ function Build-Runtime([Platform]$Platform, $Arch) {
2062
2068
- Platform $Platform `
2063
2069
- CacheScript $SourceCache \swift\cmake\caches\Runtime- $Platform - $ ($Arch.LLVMName ).cmake `
2064
2070
- UseBuiltCompilers C, CXX, Swift `
2071
+ - BuildTargets $Targets `
2065
2072
- Defines ($PlatformDefines + @ {
2066
2073
CMAKE_Swift_COMPILER_TARGET = (Get-ModuleTriple $Arch );
2067
2074
CMAKE_Swift_COMPILER_WORKS = " YES" ;
@@ -2075,7 +2082,8 @@ function Build-Runtime([Platform]$Platform, $Arch) {
2075
2082
SWIFT_ENABLE_EXPERIMENTAL_STRING_PROCESSING = " YES" ;
2076
2083
SWIFT_ENABLE_SYNCHRONIZATION = " YES" ;
2077
2084
SWIFT_ENABLE_VOLATILE = " YES" ;
2078
- SWIFT_NATIVE_SWIFT_TOOLS_PATH = (Join-Path - Path $CompilersBinaryCache - ChildPath " bin" );
2085
+ SWIFT_NATIVE_LLVM_TOOLS_PATH = $NativeToolsPath ;
2086
+ SWIFT_NATIVE_SWIFT_TOOLS_PATH = $NativeToolsPath ;
2079
2087
SWIFT_PATH_TO_LIBDISPATCH_SOURCE = " $SourceCache \swift-corelibs-libdispatch" ;
2080
2088
SWIFT_PATH_TO_STRING_PROCESSING_SOURCE = " $SourceCache \swift-experimental-string-processing" ;
2081
2089
CMAKE_SHARED_LINKER_FLAGS = if ($Platform -eq " Windows" ) { @ (" /INCREMENTAL:NO" , " /OPT:REF" , " /OPT:ICF" ) } else { @ () };
@@ -3270,6 +3278,11 @@ if (-not $IsCrossCompiling) {
3270
3278
Build-Compilers $HostArch @Tests
3271
3279
}
3272
3280
3281
+ if ($Test -contains " android" ) {
3282
+ Build-Runtime Android $AndroidX64 - Test
3283
+ Build-Runtime Android $AndroidARM64 - Test
3284
+ }
3285
+
3273
3286
if ($Test -contains " dispatch" ) {
3274
3287
Build-Dispatch Windows $HostArch - Test
3275
3288
}
0 commit comments