@@ -211,7 +211,7 @@ if ($AndroidSDKs.Length -gt 0) {
211
211
212
212
if ($Test -contains " *" ) {
213
213
# Explicitly don't include llbuild yet since tests are known to fail on Windows
214
- $Test = @ (" lld" , " lldb" , " swift" , " dispatch" , " foundation" , " xctest" , " swift-format" , " sourcekit-lsp" )
214
+ $Test = @ (" lld" , " lldb" , " swift" , " dispatch" , " foundation" , " xctest" , " swift-format" , " sourcekit-lsp" , " android " )
215
215
}
216
216
217
217
# Architecture definitions
@@ -1935,17 +1935,22 @@ function Build-CURL([Platform]$Platform, $Arch) {
1935
1935
})
1936
1936
}
1937
1937
1938
- function Build-Runtime ([Platform ]$Platform , $Arch ) {
1938
+ function Build-Runtime ([Platform ]$Platform , $Arch , [switch ]$Test = $false ) {
1939
+ $Targets = @ (" install" )
1939
1940
$PlatformDefines = @ {}
1940
1941
if ($Platform -eq " Android" ) {
1941
1942
$PlatformDefines += @ {
1942
1943
LLVM_ENABLE_LIBCXX = " YES" ;
1943
1944
SWIFT_USE_LINKER = " lld" ;
1944
- SWIFT_INCLUDE_TESTS = " NO" ;
1945
- SWIFT_INCLUDE_TEST_BINARIES = " NO" ;
1946
1945
}
1947
1946
}
1948
-
1947
+ if ($Test ) {
1948
+ $Targets += @ (" check-swift-all-only_non_executable" )
1949
+ $PlatformDefines += @ {
1950
+ SWIFT_INCLUDE_TESTS = " YES" ;
1951
+ SWIFT_BUILD_TEST_SUPPORT_MODULES = " YES" ;
1952
+ }
1953
+ }
1949
1954
1950
1955
Isolate- EnvVars {
1951
1956
$env: Path = " $ ( Get-CMarkBinaryCache $Arch ) \src;$ ( Get-PinnedToolchainRuntime ) ;${env: Path} "
@@ -1956,6 +1961,7 @@ function Build-Runtime([Platform]$Platform, $Arch) {
1956
1961
Get-HostProjectBinaryCache Compilers
1957
1962
}
1958
1963
1964
+ $NativeToolsPath = Join-Path - Path $CompilersBinaryCache - ChildPath " bin"
1959
1965
Build-CMakeProject `
1960
1966
- Src $SourceCache \swift `
1961
1967
- Bin (Get-TargetProjectBinaryCache $Arch Runtime) `
@@ -1964,6 +1970,7 @@ function Build-Runtime([Platform]$Platform, $Arch) {
1964
1970
- Platform $Platform `
1965
1971
- CacheScript $SourceCache \swift\cmake\caches\Runtime- $Platform - $ ($Arch.LLVMName ).cmake `
1966
1972
- UseBuiltCompilers C, CXX, Swift `
1973
+ - BuildTargets $Targets `
1967
1974
- Defines ($PlatformDefines + @ {
1968
1975
CMAKE_Swift_COMPILER_TARGET = $Arch.LLVMTarget.Replace (" $AndroidAPILevel " , " " );
1969
1976
CMAKE_Swift_COMPILER_WORKS = " YES" ;
@@ -1977,7 +1984,8 @@ function Build-Runtime([Platform]$Platform, $Arch) {
1977
1984
SWIFT_ENABLE_EXPERIMENTAL_STRING_PROCESSING = " YES" ;
1978
1985
SWIFT_ENABLE_SYNCHRONIZATION = " YES" ;
1979
1986
SWIFT_ENABLE_VOLATILE = " YES" ;
1980
- SWIFT_NATIVE_SWIFT_TOOLS_PATH = (Join-Path - Path $CompilersBinaryCache - ChildPath " bin" );
1987
+ SWIFT_NATIVE_LLVM_TOOLS_PATH = $NativeToolsPath ;
1988
+ SWIFT_NATIVE_SWIFT_TOOLS_PATH = $NativeToolsPath ;
1981
1989
SWIFT_PATH_TO_LIBDISPATCH_SOURCE = " $SourceCache \swift-corelibs-libdispatch" ;
1982
1990
SWIFT_PATH_TO_STRING_PROCESSING_SOURCE = " $SourceCache \swift-experimental-string-processing" ;
1983
1991
CMAKE_SHARED_LINKER_FLAGS = if ($Platform -eq " Windows" ) { @ (" /INCREMENTAL:NO" , " /OPT:REF" , " /OPT:ICF" ) } else { @ () };
@@ -3071,6 +3079,11 @@ if (-not $IsCrossCompiling) {
3071
3079
Build-Compilers $HostArch @Tests
3072
3080
}
3073
3081
3082
+ if ($Test -contains " android" ) {
3083
+ Build-Runtime Android $AndroidX64 - Test
3084
+ Build-Runtime Android $AndroidARM64 - Test
3085
+ }
3086
+
3074
3087
if ($Test -contains " dispatch" ) {
3075
3088
Build-Dispatch Windows $HostArch - Test
3076
3089
}
0 commit comments