@@ -2910,58 +2910,19 @@ function Test-Dispatch {
2910
2910
}
2911
2911
}
2912
2912
2913
- function Build-Foundation {
2914
- [CmdletBinding (PositionalBinding = $false )]
2915
- param
2916
- (
2917
- [Parameter (Position = 0 , Mandatory = $true )]
2918
- [Hashtable ] $Platform ,
2919
- [switch ] $Static = $false
2920
- )
2921
-
2922
- $FoundationBinaryCache = if ($Static ) {
2923
- Get-ProjectBinaryCache $Platform ExperimentalStaticFoundation
2924
- } else {
2925
- Get-ProjectBinaryCache $Platform DynamicFoundation
2926
- }
2927
-
2928
- $FoundationImage = if ($Static ) {
2929
- " $ ( Get-SwiftSDK $Platform.OS - Identifier " $ ( $Platform.OS ) Experimental" ) \usr"
2930
- } else {
2931
- " $ ( Get-SwiftSDK $Platform.OS ) \usr"
2932
- }
2933
-
2934
- $SwiftSDK = if ($Static ) {
2935
- Get-SwiftSDK $Platform.OS - Identifier " $ ( $Platform.OS ) Experimental"
2936
- } else {
2937
- Get-SwiftSDK $Platform.OS
2938
- }
2939
-
2940
- $SwiftFlags = if ($Static ) {
2941
- @ (" -static-stdlib" , " -Xfrontend" , " -use-static-resource-dir" )
2942
- } else {
2943
- @ ()
2944
- }
2945
-
2946
- $DispatchCMakeModules = if ($Static ) {
2947
- Get-ProjectCMakeModules $Platform ExperimentalStaticDispatch
2948
- } else {
2949
- Get-ProjectCMakeModules $Platform Dispatch
2950
- }
2951
-
2913
+ function Build-Foundation ([Hashtable ] $Platform ) {
2952
2914
Build-CMakeProject `
2953
2915
- Src $SourceCache \swift- corelibs- foundation `
2954
- - Bin $FoundationBinaryCache `
2955
- - InstallTo $FoundationImage `
2916
+ - Bin ( Get-ProjectBinaryCache $Platform DynamicFoundation) `
2917
+ - InstallTo " $ ( Get-SwiftSDK $Platform .OS ) \usr " `
2956
2918
- Platform $Platform `
2957
2919
- UseBuiltCompilers C, CXX, Swift `
2958
- - SwiftSDK $ SwiftSDK `
2920
+ - SwiftSDK ( Get- SwiftSDK $Platform .OS ) `
2959
2921
- Defines @ {
2960
- BUILD_SHARED_LIBS = if ( $Static ) { " NO " } else { " YES" } ;
2922
+ BUILD_SHARED_LIBS = " YES" ;
2961
2923
# FIXME(compnerd) - workaround ARM64 build failure when cross-compiling.
2962
2924
CMAKE_NINJA_FORCE_RESPONSE_FILE = " YES" ;
2963
2925
CMAKE_STATIC_LIBRARY_PREFIX_Swift = " lib" ;
2964
- CMAKE_Swift_FLAGS = $SwiftFlags ;
2965
2926
FOUNDATION_BUILD_TOOLS = if ($Platform.OS -eq [OS ]::Windows) { " YES" } else { " NO" };
2966
2927
CURL_DIR = " $BinaryCache \$ ( $Platform.Triple ) \usr\lib\cmake\CURL" ;
2967
2928
LibXml2_DIR = " $BinaryCache \$ ( $Platform.Triple ) \usr\lib\cmake\libxml2-2.11.5" ;
@@ -2971,7 +2932,7 @@ function Build-Foundation {
2971
2932
" $BinaryCache \$ ( $Platform.Triple ) \usr\lib\libz.a"
2972
2933
};
2973
2934
ZLIB_INCLUDE_DIR = " $BinaryCache \$ ( $Platform.Triple ) \usr\include" ;
2974
- dispatch_DIR = $DispatchCMakeModules ;
2935
+ dispatch_DIR = ( Get-ProjectCMakeModules $Platform Dispatch) ;
2975
2936
_SwiftFoundation_SourceDIR = " $SourceCache \swift-foundation" ;
2976
2937
_SwiftFoundationICU_SourceDIR = " $SourceCache \swift-foundation-icu" ;
2977
2938
_SwiftCollections_SourceDIR = " $SourceCache \swift-collections" ;
0 commit comments