@@ -204,7 +204,7 @@ if ($AndroidSDKs.Length -gt 0) {
204
204
205
205
if ($Test -contains " *" ) {
206
206
# Explicitly don't include llbuild yet since tests are known to fail on Windows
207
- $Test = @ (" lld" , " lldb" , " swift" , " dispatch" , " foundation" , " xctest" , " swift-format" , " sourcekit-lsp" )
207
+ $Test = @ (" lld" , " lldb" , " swift" , " dispatch" , " foundation" , " xctest" , " swift-format" , " sourcekit-lsp" , " android " )
208
208
}
209
209
210
210
# Architecture definitions
@@ -2005,17 +2005,22 @@ function Build-CURL([Platform]$Platform, $Arch) {
2005
2005
})
2006
2006
}
2007
2007
2008
- function Build-Runtime ([Platform ]$Platform , $Arch ) {
2008
+ function Build-Runtime ([Platform ]$Platform , $Arch , [switch ]$Test = $false ) {
2009
+ $Targets = @ (" install" )
2009
2010
$PlatformDefines = @ {}
2010
2011
if ($Platform -eq " Android" ) {
2011
2012
$PlatformDefines += @ {
2012
2013
LLVM_ENABLE_LIBCXX = " YES" ;
2013
2014
SWIFT_USE_LINKER = " lld" ;
2014
- SWIFT_INCLUDE_TESTS = " NO" ;
2015
- SWIFT_INCLUDE_TEST_BINARIES = " NO" ;
2016
2015
}
2017
2016
}
2018
-
2017
+ if ($Test ) {
2018
+ $Targets += @ (" check-swift-all-only_non_executable" )
2019
+ $PlatformDefines += @ {
2020
+ SWIFT_INCLUDE_TESTS = " YES" ;
2021
+ SWIFT_BUILD_TEST_SUPPORT_MODULES = " YES" ;
2022
+ }
2023
+ }
2019
2024
2020
2025
Isolate- EnvVars {
2021
2026
$env: Path = " $ ( Get-CMarkBinaryCache $Arch ) \src;$ ( Get-PinnedToolchainRuntime ) ;${env: Path} "
@@ -2026,6 +2031,7 @@ function Build-Runtime([Platform]$Platform, $Arch) {
2026
2031
Get-HostProjectBinaryCache Compilers
2027
2032
}
2028
2033
2034
+ $NativeToolsPath = Join-Path - Path $CompilersBinaryCache - ChildPath " bin"
2029
2035
Build-CMakeProject `
2030
2036
- Src $SourceCache \swift `
2031
2037
- Bin (Get-TargetProjectBinaryCache $Arch Runtime) `
@@ -2034,6 +2040,7 @@ function Build-Runtime([Platform]$Platform, $Arch) {
2034
2040
- Platform $Platform `
2035
2041
- CacheScript $SourceCache \swift\cmake\caches\Runtime- $Platform - $ ($Arch.LLVMName ).cmake `
2036
2042
- UseBuiltCompilers C, CXX, Swift `
2043
+ - BuildTargets $Targets `
2037
2044
- Defines ($PlatformDefines + @ {
2038
2045
CMAKE_Swift_COMPILER_TARGET = (Get-ModuleTriple $Arch );
2039
2046
CMAKE_Swift_COMPILER_WORKS = " YES" ;
@@ -2047,7 +2054,8 @@ function Build-Runtime([Platform]$Platform, $Arch) {
2047
2054
SWIFT_ENABLE_EXPERIMENTAL_STRING_PROCESSING = " YES" ;
2048
2055
SWIFT_ENABLE_SYNCHRONIZATION = " YES" ;
2049
2056
SWIFT_ENABLE_VOLATILE = " YES" ;
2050
- SWIFT_NATIVE_SWIFT_TOOLS_PATH = (Join-Path - Path $CompilersBinaryCache - ChildPath " bin" );
2057
+ SWIFT_NATIVE_LLVM_TOOLS_PATH = $NativeToolsPath ;
2058
+ SWIFT_NATIVE_SWIFT_TOOLS_PATH = $NativeToolsPath ;
2051
2059
SWIFT_PATH_TO_LIBDISPATCH_SOURCE = " $SourceCache \swift-corelibs-libdispatch" ;
2052
2060
SWIFT_PATH_TO_STRING_PROCESSING_SOURCE = " $SourceCache \swift-experimental-string-processing" ;
2053
2061
CMAKE_SHARED_LINKER_FLAGS = if ($Platform -eq " Windows" ) { @ (" /INCREMENTAL:NO" , " /OPT:REF" , " /OPT:ICF" ) } else { @ () };
@@ -3222,6 +3230,11 @@ if (-not $IsCrossCompiling) {
3222
3230
Build-Compilers $HostArch @Tests
3223
3231
}
3224
3232
3233
+ if ($Test -contains " android" ) {
3234
+ Build-Runtime Android $AndroidX64 - Test
3235
+ Build-Runtime Android $AndroidARM64 - Test
3236
+ }
3237
+
3225
3238
if ($Test -contains " dispatch" ) {
3226
3239
Build-Dispatch Windows $HostArch - Test
3227
3240
}
0 commit comments