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