@@ -395,7 +395,8 @@ function Get-TargetProjectBinaryCache($Arch, [TargetComponent]$Project) {
395
395
396
396
enum HostComponent {
397
397
Compilers = 5
398
- System = 10
398
+ FoundationMacros = 10
399
+ System
399
400
ToolsSupportCore
400
401
LLBuild
401
402
Yams
@@ -1664,7 +1665,6 @@ function Build-Foundation([Platform]$Platform, $Arch, [switch]$Test = $false) {
1664
1665
}
1665
1666
} else {
1666
1667
$DispatchBinaryCache = Get-TargetProjectBinaryCache $Arch Dispatch
1667
- $SwiftSyntaxDir = Get-HostProjectCMakeModules Compilers
1668
1668
$FoundationBinaryCache = Get-TargetProjectBinaryCache $Arch Foundation
1669
1669
$ShortArch = $Arch.LLVMName
1670
1670
@@ -1673,12 +1673,6 @@ function Build-Foundation([Platform]$Platform, $Arch, [switch]$Test = $false) {
1673
1673
$Targets = @ (" default" )
1674
1674
$InstallPath = " $ ( $Arch.SDKInstallRoot ) \usr"
1675
1675
1676
- if ($Platform -eq " Android" ) {
1677
- $HostDefines = @ { CMAKE_HOST_Swift_FLAGS = " -sdk `" $ ( $HostArch.SDKInstallRoot ) `" " }
1678
- } else {
1679
- $HostDefines = @ {}
1680
- }
1681
-
1682
1676
Build-CMakeProject `
1683
1677
- Src $SourceCache \swift- corelibs- foundation `
1684
1678
- Bin $FoundationBinaryCache `
@@ -1688,6 +1682,7 @@ function Build-Foundation([Platform]$Platform, $Arch, [switch]$Test = $false) {
1688
1682
- UseBuiltCompilers ASM, C, CXX, Swift `
1689
1683
- BuildTargets $Targets `
1690
1684
- Defines (@ {
1685
+ CMAKE_HOST_Swift_FLAGS = " -sdk `" $ ( $HostArch.SDKInstallRoot ) `" " ;
1691
1686
FOUNDATION_BUILD_TOOLS = if ($Platform -eq " Windows" ) { " YES" } else { " NO" };
1692
1687
CURL_DIR = " $LibraryRoot \curl-8.5.0\usr\lib\$Platform \$ShortArch \cmake\CURL" ;
1693
1688
LIBXML2_LIBRARY = if ($Platform -eq " Windows" ) {
@@ -1704,15 +1699,29 @@ function Build-Foundation([Platform]$Platform, $Arch, [switch]$Test = $false) {
1704
1699
};
1705
1700
ZLIB_INCLUDE_DIR = " $LibraryRoot \zlib-1.3.1\usr\include" ;
1706
1701
dispatch_DIR = " $DispatchBinaryCache \cmake\modules" ;
1707
- SwiftSyntax_DIR = " $SwiftSyntaxDir " ;
1702
+ SwiftSyntax_DIR = ( Get-HostProjectCMakeModules Compilers) ;
1708
1703
_SwiftFoundation_SourceDIR = " $SourceCache \swift-foundation" ;
1709
1704
_SwiftFoundationICU_SourceDIR = " $SourceCache \swift-foundation-icu" ;
1710
- _SwiftCollections_SourceDIR = " $SourceCache \swift-collections"
1711
- } + $HostDefines + $ TestingDefines )
1705
+ _SwiftCollections_SourceDIR = " $SourceCache \swift-collections" ;
1706
+ } + $TestingDefines )
1712
1707
}
1713
1708
}
1714
1709
}
1715
1710
1711
+ function Build-FoundationMacros ([Platform ]$Platform , $Arch ) {
1712
+ Build-CMakeProject `
1713
+ - Src $SourceCache \swift- foundation\Sources\FoundationMacros `
1714
+ - Bin (Get-HostProjectBinaryCache FoundationMacros) `
1715
+ - InstallTo " $ ( $Arch.ToolchainInstallRoot ) \usr" `
1716
+ - Arch $Arch `
1717
+ - Platform $Platform `
1718
+ - UseBuiltCompilers Swift `
1719
+ - BuildTargets @ (" default" , " install" ) `
1720
+ - Defines @ {
1721
+ SwiftSyntax_DIR = (Get-HostProjectCMakeModules Compilers);
1722
+ }
1723
+ }
1724
+
1716
1725
function Build-XCTest ([Platform ]$Platform , $Arch , [switch ]$Test = $false ) {
1717
1726
$DispatchBinaryCache = Get-TargetProjectBinaryCache $Arch Dispatch
1718
1727
$FoundationBinaryCache = Get-TargetProjectBinaryCache $Arch Foundation
@@ -2378,6 +2387,9 @@ if (-not $ToBatch) {
2378
2387
}
2379
2388
2380
2389
if (-not $SkipBuild ) {
2390
+ # Build Macros for distribution
2391
+ Invoke-BuildStep Build-FoundationMacros Windows $HostArch
2392
+
2381
2393
Invoke-BuildStep Build-SQLite $HostArch
2382
2394
Invoke-BuildStep Build-System $HostArch
2383
2395
Invoke-BuildStep Build-ToolsSupportCore $HostArch
0 commit comments