@@ -1647,79 +1647,93 @@ function Build-Dispatch([Platform]$Platform, $Arch, [switch]$Test = $false) {
1647
1647
}
1648
1648
1649
1649
function Build-Foundation ([Platform ]$Platform , $Arch , [switch ]$Test = $false ) {
1650
- $DispatchBinaryCache = Get-TargetProjectBinaryCache $Arch Dispatch
1651
- $SwiftSyntaxDir = Get-HostProjectCMakeModules Compilers
1652
- $FoundationBinaryCache = Get-TargetProjectBinaryCache $Arch Foundation
1653
- $ShortArch = $Arch.LLVMName
1650
+ if ($Test ) {
1651
+ # Foundation tests build via swiftpm rather than CMake
1652
+ $OutDir = Join-Path - Path $HostArch.BinaryCache - ChildPath swift- foundation- tests
1654
1653
1655
- Isolate- EnvVars {
1656
- if ($Test ) {
1657
- $XCTestBinaryCache = Get-TargetProjectBinaryCache $Arch XCTest
1658
- $TestingDefines = @ {
1659
- ENABLE_TESTING = " YES" ;
1660
- XCTest_DIR = " $XCTestBinaryCache \cmake\modules" ;
1661
- }
1662
- $Targets = @ (" default" , " test" )
1663
- $env: Path = " $XCTestBinaryCache ;$FoundationBinaryCache \bin;$DispatchBinaryCache ;$ ( Get-TargetProjectBinaryCache $Arch Runtime) \bin;$env: Path "
1664
- $InstallPath = " "
1665
- } else {
1654
+ Isolate- EnvVars {
1655
+ $env: SWIFTCI_USE_LOCAL_DEPS = 1
1656
+ Build-SPMProject `
1657
+ - Test `
1658
+ - Src $SourceCache \swift- foundation `
1659
+ - Bin $OutDir `
1660
+ - Arch $HostArch
1661
+ }
1662
+
1663
+ $OutDir = Join-Path - Path $HostArch.BinaryCache - ChildPath foundation- tests
1664
+
1665
+ Isolate- EnvVars {
1666
+ $env: SWIFTCI_USE_LOCAL_DEPS = 1
1667
+ Build-SPMProject `
1668
+ - Test `
1669
+ - Src $SourceCache \swift- corelibs- foundation `
1670
+ - Bin $OutDir `
1671
+ - Arch $HostArch
1672
+ }
1673
+ } else {
1674
+ $DispatchBinaryCache = Get-TargetProjectBinaryCache $Arch Dispatch
1675
+ $SwiftSyntaxDir = Get-HostProjectCMakeModules Compilers
1676
+ $FoundationBinaryCache = Get-TargetProjectBinaryCache $Arch Foundation
1677
+ $ShortArch = $Arch.LLVMName
1678
+
1679
+ Isolate- EnvVars {
1666
1680
$TestingDefines = @ { ENABLE_TESTING = " NO" }
1667
1681
$Targets = @ (" default" , " install" )
1668
1682
$InstallPath = " $ ( $Arch.SDKInstallRoot ) \usr"
1669
- }
1670
1683
1671
- $env: CTEST_OUTPUT_ON_FAILURE = 1
1672
- Build-CMakeProject `
1673
- - Src $SourceCache \swift- corelibs- foundation `
1674
- - Bin $FoundationBinaryCache `
1675
- - InstallTo $InstallPath `
1676
- - Arch $Arch `
1677
- - Platform $Platform `
1678
- - UseBuiltCompilers ASM, C, CXX, Swift `
1679
- - BuildTargets $Targets `
1680
- - Defines (@ {
1681
- FOUNDATION_BUILD_TOOLS = if ($Platform -eq " Windows" ) { " YES" } else { " NO" };
1682
- # Turn off safeseh for lld as it has safeseh enabled by default
1683
- # and fails with an ICU data object file icudt69l_dat.obj. This
1684
- # matters to X86 only.
1685
- CMAKE_Swift_FLAGS = if ($Arch -eq $ArchX86 ) { @ (" -Xlinker" , " /SAFESEH:NO" ) } else { " " };
1686
- CURL_DIR = " $LibraryRoot \curl-8.5.0\usr\lib\$Platform \$ShortArch \cmake\CURL" ;
1687
- ICU_DATA_LIBRARY_RELEASE = if ($Platform -eq " Windows" ) {
1688
- " $LibraryRoot \icu-69.1\usr\lib\$Platform \$ShortArch \sicudt69.lib"
1689
- } else {
1690
- " $LibraryRoot \icu-69.1\usr\lib\$Platform \$ShortArch \libicudt69.a"
1691
- };
1692
- ICU_I18N_LIBRARY_RELEASE = if ($Platform -eq " Windows" ) {
1693
- " $LibraryRoot \icu-69.1\usr\lib\$Platform \$ShortArch \sicuin69.lib"
1694
- } else {
1695
- " $LibraryRoot \icu-69.1\usr\lib\$Platform \$ShortArch \libicuin69.a"
1696
- };
1697
- ICU_ROOT = " $LibraryRoot \icu-69.1\usr" ;
1698
- ICU_INCLUDE_DIR = " $LibraryRoot \icu-69.1\usr\include" ;
1699
- ICU_UC_LIBRARY_RELEASE = if ($Platform -eq " Windows" ) {
1700
- " $LibraryRoot \icu-69.1\usr\lib\$Platform \$ShortArch \sicuuc69.lib" ;
1701
- } else {
1702
- " $LibraryRoot \icu-69.1\usr\lib\$Platform \$ShortArch \libicuuc69.a"
1703
- };
1704
- LIBXML2_LIBRARY = if ($Platform -eq " Windows" ) {
1705
- " $LibraryRoot \libxml2-2.11.5\usr\lib\$Platform \$ShortArch \libxml2s.lib" ;
1706
- } else {
1707
- " $LibraryRoot \libxml2-2.11.5\usr\lib\$Platform \$ShortArch \libxml2.a" ;
1708
- };
1709
- LIBXML2_INCLUDE_DIR = " $LibraryRoot \libxml2-2.11.5\usr\include\libxml2" ;
1710
- LIBXML2_DEFINITIONS = " -DLIBXML_STATIC" ;
1711
- ZLIB_LIBRARY = if ($Platform -eq " Windows" ) {
1712
- " $LibraryRoot \zlib-1.3.1\usr\lib\$Platform \$ShortArch \zlibstatic.lib"
1713
- } else {
1714
- " $LibraryRoot \zlib-1.3.1\usr\lib\$Platform \$ShortArch \libz.a"
1715
- };
1716
- ZLIB_INCLUDE_DIR = " $LibraryRoot \zlib-1.3.1\usr\include" ;
1717
- dispatch_DIR = " $DispatchBinaryCache \cmake\modules" ;
1718
- SwiftSyntax_DIR = " $SwiftSyntaxDir " ;
1719
- _SwiftFoundation_SourceDIR = " $SourceCache \swift-foundation" ;
1720
- _SwiftFoundationICU_SourceDIR = " $SourceCache \swift-foundation-icu" ;
1721
- _SwiftCollections_SourceDIR = " $SourceCache \swift-collections"
1722
- } + $TestingDefines )
1684
+ $env: CTEST_OUTPUT_ON_FAILURE = 1
1685
+ Build-CMakeProject `
1686
+ - Src $SourceCache \swift- corelibs- foundation `
1687
+ - Bin $FoundationBinaryCache `
1688
+ - InstallTo $InstallPath `
1689
+ - Arch $Arch `
1690
+ - Platform $Platform `
1691
+ - UseBuiltCompilers ASM, C, CXX, Swift `
1692
+ - BuildTargets $Targets `
1693
+ - Defines (@ {
1694
+ FOUNDATION_BUILD_TOOLS = if ($Platform -eq " Windows" ) { " YES" } else { " NO" };
1695
+ # Turn off safeseh for lld as it has safeseh enabled by default
1696
+ # and fails with an ICU data object file icudt69l_dat.obj. This
1697
+ # matters to X86 only.
1698
+ CMAKE_Swift_FLAGS = if ($Arch -eq $ArchX86 ) { @ (" -Xlinker" , " /SAFESEH:NO" ) } else { " " };
1699
+ CURL_DIR = " $LibraryRoot \curl-8.5.0\usr\lib\$Platform \$ShortArch \cmake\CURL" ;
1700
+ ICU_DATA_LIBRARY_RELEASE = if ($Platform -eq " Windows" ) {
1701
+ " $LibraryRoot \icu-69.1\usr\lib\$Platform \$ShortArch \sicudt69.lib"
1702
+ } else {
1703
+ " $LibraryRoot \icu-69.1\usr\lib\$Platform \$ShortArch \libicudt69.a"
1704
+ };
1705
+ ICU_I18N_LIBRARY_RELEASE = if ($Platform -eq " Windows" ) {
1706
+ " $LibraryRoot \icu-69.1\usr\lib\$Platform \$ShortArch \sicuin69.lib"
1707
+ } else {
1708
+ " $LibraryRoot \icu-69.1\usr\lib\$Platform \$ShortArch \libicuin69.a"
1709
+ };
1710
+ ICU_ROOT = " $LibraryRoot \icu-69.1\usr" ;
1711
+ ICU_INCLUDE_DIR = " $LibraryRoot \icu-69.1\usr\include" ;
1712
+ ICU_UC_LIBRARY_RELEASE = if ($Platform -eq " Windows" ) {
1713
+ " $LibraryRoot \icu-69.1\usr\lib\$Platform \$ShortArch \sicuuc69.lib" ;
1714
+ } else {
1715
+ " $LibraryRoot \icu-69.1\usr\lib\$Platform \$ShortArch \libicuuc69.a"
1716
+ };
1717
+ LIBXML2_LIBRARY = if ($Platform -eq " Windows" ) {
1718
+ " $LibraryRoot \libxml2-2.11.5\usr\lib\$Platform \$ShortArch \libxml2s.lib" ;
1719
+ } else {
1720
+ " $LibraryRoot \libxml2-2.11.5\usr\lib\$Platform \$ShortArch \libxml2.a" ;
1721
+ };
1722
+ LIBXML2_INCLUDE_DIR = " $LibraryRoot \libxml2-2.11.5\usr\include\libxml2" ;
1723
+ LIBXML2_DEFINITIONS = " -DLIBXML_STATIC" ;
1724
+ ZLIB_LIBRARY = if ($Platform -eq " Windows" ) {
1725
+ " $LibraryRoot \zlib-1.3.1\usr\lib\$Platform \$ShortArch \zlibstatic.lib"
1726
+ } else {
1727
+ " $LibraryRoot \zlib-1.3.1\usr\lib\$Platform \$ShortArch \libz.a"
1728
+ };
1729
+ ZLIB_INCLUDE_DIR = " $LibraryRoot \zlib-1.3.1\usr\include" ;
1730
+ dispatch_DIR = " $DispatchBinaryCache \cmake\modules" ;
1731
+ SwiftSyntax_DIR = " $SwiftSyntaxDir " ;
1732
+ _SwiftFoundation_SourceDIR = " $SourceCache \swift-foundation" ;
1733
+ _SwiftFoundationICU_SourceDIR = " $SourceCache \swift-foundation-icu" ;
1734
+ _SwiftCollections_SourceDIR = " $SourceCache \swift-collections"
1735
+ } + $TestingDefines )
1736
+ }
1723
1737
}
1724
1738
}
1725
1739
0 commit comments