@@ -2507,18 +2507,37 @@ function Build-Foundation {
2507
2507
Get-ProjectBinaryCache $Platform DynamicFoundation
2508
2508
}
2509
2509
2510
+ $FoundationImage = if ($Static ) {
2511
+ " $ ( Get-SwiftSDK $Platform.OS - Identifier " $ ( $Platform.OS ) Experimental" ) \usr"
2512
+ } else {
2513
+ " $ ( Get-SwiftSDK $Platform.OS ) \usr"
2514
+ }
2515
+
2516
+ $SwiftSDK = if ($Static ) {
2517
+ Get-SwiftSDK $Platform.OS - Identifier " $ ( $Platform.OS ) Experimental"
2518
+ } else {
2519
+ Get-SwiftSDK $Platform.OS
2520
+ }
2521
+
2522
+ $SwiftFlags = if ($Static ) {
2523
+ @ (" -static-stdlib" , " -Xfrontend" , " -use-static-resource-dir" )
2524
+ } else {
2525
+ @ ()
2526
+ }
2527
+
2510
2528
Build-CMakeProject `
2511
2529
- Src $SourceCache \swift- corelibs- foundation `
2512
2530
- Bin $FoundationBinaryCache `
2513
- - InstallTo $ ( if ( $Static ) { " $ ( Get-SwiftSDK $Platform .OS - Identifier " $ ( $Platform .OS ) Experimental " ) \usr " } else { " $ ( Get-SwiftSDK $Platform .OS ) \usr " }) `
2531
+ - InstallTo $FoundationImage `
2514
2532
- Platform $Platform `
2515
2533
- UseBuiltCompilers ASM, C, CXX, Swift `
2516
- - SwiftSDK ( Get-SwiftSDK $Platform .OS ) `
2534
+ - SwiftSDK $SwiftSDK `
2517
2535
- Defines @ {
2518
2536
BUILD_SHARED_LIBS = if ($Static ) { " NO" } else { " YES" };
2519
2537
CMAKE_FIND_PACKAGE_PREFER_CONFIG = " YES" ;
2520
2538
CMAKE_NINJA_FORCE_RESPONSE_FILE = " YES" ;
2521
2539
CMAKE_STATIC_LIBRARY_PREFIX_Swift = " lib" ;
2540
+ CMAKE_Swift_FLAGS = $SwiftFlags ;
2522
2541
ENABLE_TESTING = " NO" ;
2523
2542
FOUNDATION_BUILD_TOOLS = if ($Platform.OS -eq [OS ]::Windows) { " YES" } else { " NO" };
2524
2543
CURL_DIR = " $BinaryCache \$ ( $Platform.Triple ) \usr\lib\cmake\CURL" ;
0 commit comments