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