@@ -91,6 +91,9 @@ Default: @("Android", "AndroidExperimental")
9191An array of architectures for which the Android Swift SDK should be built.
9292Default: @("aarch64", "armv7", "i686", "x86_64")
9393
94+ . PARAMETER Windows
95+ Build Windows SDKs.
96+
9497. PARAMETER WinSDKVersion
9598The version number of the Windows SDK to be used.
9699Overrides the value resolved by the Visual Studio command prompt.
@@ -189,6 +192,7 @@ param
189192 [string []] $AndroidSDKArchitectures = @ (" aarch64" , " armv7" , " i686" , " x86_64" ),
190193
191194 # Windows SDK Options
195+ [switch ] $Windows = $true ,
192196 [ValidatePattern (" ^\d+\.\d+\.\d+(?:-\w+)?" )]
193197 [string ] $WinSDKVersion = " " ,
194198 [string []] $WindowsSDKVersions = @ (" Windows" , " WindowsExperimental" ),
@@ -3812,7 +3816,12 @@ function Build-Installer([Hashtable] $Platform) {
38123816 }
38133817 }
38143818
3815- $Properties [" Platforms" ] = " `" windows$ ( if ($Android ) { " ;android" }) `" " ;
3819+ $Properties [" Platforms" ] = " `" $ (
3820+ @ (
3821+ if ($Windows ) { " windows" }
3822+ if ($Android ) { " android" }
3823+ ) -Join " ;"
3824+ ) `" " ;
38163825 $Properties [" AndroidArchitectures" ] = " `" $ ( ($AndroidSDKBuilds | ForEach-Object { $_.Architecture.LLVMName }) -Join " ;" ) `" "
38173826 $Properties [" WindowsArchitectures" ] = " `" $ ( ($WindowsSDKBuilds | ForEach-Object { $_.Architecture.LLVMName }) -Join " ;" ) `" "
38183827 $Properties [" ToolchainVariants" ] = " `" asserts$ ( if ($IncludeNoAsserts ) { " ;noasserts" }) `" " ;
@@ -3935,62 +3944,64 @@ if (-not $SkipBuild) {
39353944 SwiftSyntax_DIR = (Get-ProjectCMakeModules $BuildPlatform Compilers);
39363945 }
39373946
3938- foreach ($Build in $WindowsSDKBuilds ) {
3939- if ($IncludeDS2 ) {
3940- Invoke-BuildStep Build-DS2 $Build
3947+ if ($Windows ) {
3948+ foreach ($Build in $WindowsSDKBuilds ) {
3949+ if ($IncludeDS2 ) {
3950+ Invoke-BuildStep Build-DS2 $Build
3951+ }
3952+
3953+ Invoke-BuildStep Build-ZLib $Build
3954+ Invoke-BuildStep Build-XML2 $Build
3955+ Invoke-BuildStep Build-CURL $Build
39413956 }
39423957
3943- Invoke-BuildStep Build-ZLib $Build
3944- Invoke-BuildStep Build-XML2 $Build
3945- Invoke-BuildStep Build-CURL $Build
3946- }
3958+ foreach ($SDK in $WindowsSDKVersions ) {
3959+ switch ($SDK ) {
3960+ Windows {
3961+ foreach ($Build in $WindowsSDKBuilds ) {
3962+ Invoke-BuildStep Build-SDK $Build
39473963
3948- foreach ($SDK in $WindowsSDKVersions ) {
3949- switch ($SDK ) {
3950- Windows {
3951- foreach ($Build in $WindowsSDKBuilds ) {
3952- Invoke-BuildStep Build-SDK $Build
3964+ Get-ChildItem " $ ( Get-SwiftSDK Windows) \usr\lib\swift\windows" - Filter " *.lib" - File - ErrorAction Ignore | ForEach-Object {
3965+ Write-Host - BackgroundColor DarkRed - ForegroundColor White " $ ( $_.FullName ) is not nested in an architecture directory"
3966+ Move-Item $_.FullName " $ ( Get-SwiftSDK Windows) \usr\lib\swift\windows\$ ( $Build.Architecture.LLVMName ) \" | Out-Null
3967+ }
39533968
3954- Get-ChildItem " $ ( Get-SwiftSDK Windows) \usr\lib\swift\windows" - Filter " *.lib" - File - ErrorAction Ignore | ForEach-Object {
3955- Write-Host - BackgroundColor DarkRed - ForegroundColor White " $ ( $_.FullName ) is not nested in an architecture directory"
3956- Move-Item $_.FullName " $ ( Get-SwiftSDK Windows) \usr\lib\swift\windows\$ ( $Build.Architecture.LLVMName ) \" | Out-Null
3969+ # FIXME(compnerd) how do we select which SDK is meant to be re-distributed?
3970+ Copy-Directory " $ ( Get-SwiftSDK Windows) \usr\bin" " $ ( [IO.Path ]::Combine((Get-InstallDir $Build ), " Runtimes" , $ProductVersion , " usr" )) "
39573971 }
39583972
3959- # FIXME(compnerd) how do we select which SDK is meant to be re-distributed?
3960- Copy-Directory " $ ( Get-SwiftSDK Windows) \usr\bin " " $ ( [ IO.Path ]::Combine(( Get-InstallDir $Build ) , " Runtimes " , $ProductVersion , " usr " ) ) "
3973+ Install- SDK $WindowsSDKBuilds
3974+ Write-SDKSettings Windows
39613975 }
39623976
3963- Install-SDK $WindowsSDKBuilds
3964- Write-SDKSettings Windows
3965- }
3977+ WindowsExperimental {
3978+ foreach ( $Build in $WindowsSDKBuilds ) {
3979+ Invoke-BuildStep Build-ExperimentalSDK $Build
39663980
3967- WindowsExperimental {
3968- foreach ($Build in $WindowsSDKBuilds ) {
3969- Invoke-BuildStep Build-ExperimentalSDK $Build
3981+ $SDKROOT = Get-SwiftSDK Windows - Identifier WindowsExperimental
39703982
3971- $SDKROOT = Get-SwiftSDK Windows - Identifier WindowsExperimental
3983+ Get-ChildItem " $ ( Get-SwiftSDK Windows - Identifier WindowsExperimental) \usr\lib\swift\windows" - Filter " *.lib" - File - ErrorAction Ignore | ForEach-Object {
3984+ Write-Host - BackgroundColor DarkRed - ForegroundColor White " $ ( $_.FullName ) is not nested in an architecture directory"
3985+ Move-Item $_.FullName " $SDKROOT \usr\lib\swift\windows\$ ( $Build.Architecture.LLVMName ) \" | Out-Null
3986+ }
39723987
3973- Get-ChildItem " $ ( Get-SwiftSDK Windows - Identifier WindowsExperimental) \usr\lib\swift \windows" - Filter " *.lib" - File - ErrorAction Ignore | ForEach-Object {
3974- Write-Host - BackgroundColor DarkRed - ForegroundColor White " $ ( $_.FullName ) is not nested in an architecture directory"
3975- Move-Item $_.FullName " $SDKROOT \usr\lib\swift \windows\$ ( $Build.Architecture.LLVMName ) \" | Out-Null
3976- }
3988+ Get-ChildItem " $ ( Get-SwiftSDK Windows - Identifier WindowsExperimental) \usr\lib\swift_static \windows" - Filter " *.lib" - File - ErrorAction Ignore | ForEach-Object {
3989+ Write-Host - BackgroundColor DarkRed - ForegroundColor White " $ ( $_.FullName ) is not nested in an architecture directory"
3990+ Move-Item $_.FullName " $SDKROOT \usr\lib\swift_static \windows\$ ( $Build.Architecture.LLVMName ) \" | Out-Null
3991+ }
39773992
3978- Get-ChildItem " $ ( Get-SwiftSDK Windows - Identifier WindowsExperimental) \usr\lib\swift_static\windows" - Filter " *.lib" - File - ErrorAction Ignore | ForEach-Object {
3979- Write-Host - BackgroundColor DarkRed - ForegroundColor White " $ ( $_.FullName ) is not nested in an architecture directory"
3980- Move-Item $_.FullName " $SDKROOT \usr\lib\swift_static\windows\$ ( $Build.Architecture.LLVMName ) \" | Out-Null
3993+ # FIXME(compnerd) how do we select which SDK is meant to be re-distributed?
3994+ Copy-Directory " $ ( Get-SwiftSDK Windows - Identifier WindowsExperimental) \usr\bin" " $ ( [IO.Path ]::Combine((Get-InstallDir $Build ), " Runtimes" , " $ProductVersion .experimental" , " usr" )) "
39813995 }
39823996
3983- # FIXME(compnerd) how do we select which SDK is meant to be re-distributed?
3984- Copy-Directory " $ ( Get-SwiftSDK Windows - Identifier WindowsExperimental) \usr\bin " " $ ( [ IO.Path ]::Combine(( Get-InstallDir $Build ) , " Runtimes " , " $ProductVersion .experimental " , " usr " ) ) "
3997+ Install- SDK $WindowsSDKBuilds - Identifier WindowsExperimental
3998+ Write-SDKSettings Windows - Identifier WindowsExperimental
39853999 }
3986-
3987- Install-SDK $WindowsSDKBuilds - Identifier WindowsExperimental
3988- Write-SDKSettings Windows - Identifier WindowsExperimental
39894000 }
39904001 }
3991- }
39924002
3993- Write-PlatformInfoPlist Windows
4003+ Write-PlatformInfoPlist Windows
4004+ }
39944005
39954006 if ($Android ) {
39964007 foreach ($Build in $AndroidSDKBuilds ) {
0 commit comments