@@ -2637,22 +2637,26 @@ function Write-PlatformInfoPlist([OS] $OS) {
2637
2637
# Copies files installed by CMake from the arch-specific platform root,
2638
2638
# where they follow the layout expected by the installer,
2639
2639
# to the final platform root, following the installer layout.
2640
- function Install-Platform ([Hashtable []] $Platforms , [OS ] $OS ) {
2640
+ function Install-SDK ([Hashtable []] $Platforms , [OS ] $OS = $Platforms [ 0 ].OS , [ string ] $Identifier = $OS .ToString () ) {
2641
2641
# Copy SDK header files
2642
2642
foreach ($Module in (" Block" , " dispatch" , " os" , " _foundation_unicode" , " _FoundationCShims" )) {
2643
- $ModuleDirectory = " $ ( Get-SwiftSDK $OS ) \usr\lib\swift\$Module "
2644
- if (Test-Path $ModuleDirectory ) {
2645
- Move-Directory $ModuleDirectory " $ ( Get-SwiftSDK $OS ) \usr\include\"
2643
+ foreach ($ResourceType in (" swift" , " swift_static" )) {
2644
+ $ModuleDirectory = " $ ( Get-SwiftSDK $OS - Identifier $Identifier ) \usr\lib\$ResourceType \$Module "
2645
+ if (Test-Path $ModuleDirectory ) {
2646
+ Move-Directory $ModuleDirectory " $ ( Get-SwiftSDK $OS - Identifier $Identifier ) \usr\include\"
2647
+ }
2646
2648
}
2647
2649
}
2648
2650
2649
2651
# Copy files from the arch subdirectory, including "*.swiftmodule" which need restructuring
2650
2652
foreach ($Platform in $Platforms ) {
2651
- $PlatformResources = " $ ( Get-SwiftSDK $Platform.OS ) \usr\lib\swift\$ ( $Platform.OS.ToString ().ToLowerInvariant()) "
2652
- Get-ChildItem - Recurse " $PlatformResources \$ ( $Platform.Architecture.LLVMName ) " | ForEach-Object {
2653
- if (" .swiftmodule" , " .swiftdoc" , " .swiftinterface" -contains $_.Extension ) {
2654
- Write-Host - BackgroundColor DarkRed - ForegroundColor White " $ ( $_.FullName ) is not in a thick module layout"
2655
- Copy-File $_.FullName " $PlatformResources \$ ( $_.BaseName ) .swiftmodule\$ ( Get-ModuleTriple $Platform ) $ ( $_.Extension ) "
2653
+ foreach ($ResourceType in (" swift" , " swift_static" )) {
2654
+ $PlatformResources = " $ ( Get-SwiftSDK $OS - Identifier $Identifier ) \usr\lib\$ResourceType \$ ( $OS.ToString ().ToLowerInvariant()) "
2655
+ Get-ChildItem - Recurse " $PlatformResources \$ ( $Platform.Architecture.LLVMName ) " | ForEach-Object {
2656
+ if (" .swiftmodule" , " .swiftdoc" , " .swiftinterface" -contains $_.Extension ) {
2657
+ Write-Host - BackgroundColor DarkRed - ForegroundColor White " $ ( $_.FullName ) is not in a thick module layout"
2658
+ Copy-File $_.FullName " $PlatformResources \$ ( $_.BaseName ) .swiftmodule\$ ( Get-ModuleTriple $Platform ) $ ( $_.Extension ) "
2659
+ }
2656
2660
}
2657
2661
}
2658
2662
}
@@ -3334,9 +3338,10 @@ if (-not $SkipBuild) {
3334
3338
Copy-Directory " $ ( Get-SwiftSDK Windows) \usr\bin" " $ ( [IO.Path ]::Combine((Get-InstallDir $Platform ), " Runtimes" , $ProductVersion , " usr" )) "
3335
3339
}
3336
3340
3337
- Install-Platform $WindowsSDKPlatforms Windows
3338
3341
Write-PlatformInfoPlist Windows
3342
+ Install-SDK $WindowsSDKPlatforms
3339
3343
Write-SDKSettings Windows
3344
+ Install-SDK $WindowsSDKPlatforms - Identifier WindowsExperimental
3340
3345
Write-SDKSettings Windows - Identifier WindowsExperimental
3341
3346
3342
3347
if ($Android ) {
@@ -3350,9 +3355,10 @@ if (-not $SkipBuild) {
3350
3355
}
3351
3356
}
3352
3357
3353
- Install-Platform $AndroidSDKPlatforms Android
3354
3358
Write-PlatformInfoPlist Android
3359
+ Install-SDK $AndroidSDKPlatforms
3355
3360
Write-SDKSettings Android
3361
+ Install-SDK $AndroidSDKPlatforms - Identifiers AndroidExperimental
3356
3362
Write-SDKSettings Android - Identifier AndroidExperimental
3357
3363
3358
3364
# Android swift-inspect only supports 64-bit platforms.
0 commit comments