@@ -542,18 +542,18 @@ function Get-PythonScriptsPath {
542
542
543
543
function Get-InstallDir ([Hashtable ] $Platform ) {
544
544
if ($Platform -eq $HostPlatform ) {
545
- $ProgramFilesName = " Program Files"
546
- } elseif ( $Platform -eq $KnownPlatforms [ " WindowsX86 " ]) {
547
- $ProgramFilesName = " Program Files (x86) "
548
- } elseif (( $HostPlatform -eq $KnownPlatforms [ " WindowsARM64 " ]) -and ( $Platform -eq $KnownPlatforms [ " WindowsX64 " ])) {
549
- # x64 programs actually install under "Program Files" on arm64,
550
- # but this would conflict with the native installation.
551
- $ProgramFilesName = " Program Files (Amd64)"
552
- } else {
553
- # arm64 cannot be installed on x64
554
- return $null
545
+ return [ IO.Path ]::Combine( " $ImageRoot \ " , " Program Files" , " Swift " )
546
+ }
547
+ if ( $Platform -eq $KnownPlatforms [ " WindowsARM64 " ]) {
548
+ return [ IO.Path ]::Combine( " $ImageRoot \ " , " Program Files (Arm64) " , " Swift " )
549
+ }
550
+ if ( $Platform -eq $KnownPlatforms [ " WindowsX64 " ]) {
551
+ return [ IO.Path ]::Combine( " $ImageRoot \ " , " Program Files (Amd64)" , " Swift " )
552
+ }
553
+ if ( $Platform -eq $KnownPlatforms [ " WindowsX86 " ]) {
554
+ return [ IO.Path ]::Combine( " $ImageRoot \ " , " Program Files (x86) " , " Swift " )
555
555
}
556
- return " $ImageRoot \ $ProgramFilesName \Swift "
556
+ throw " Unknown Platform "
557
557
}
558
558
559
559
# For dev productivity, install the host toolchain directly using CMake.
@@ -1607,10 +1607,7 @@ function Build-WiXProject() {
1607
1607
Add-KeyValueIfNew $Properties ProductArchitecture $Platform.Architecture.VSName
1608
1608
Add-KeyValueIfNew $Properties ProductVersion $ProductVersionArg
1609
1609
1610
- $MSBuildArgs = @ (" $SourceCache \swift-installer-scripts\platforms\Windows\$FileName " )
1611
- $MSBuildArgs += " -noLogo"
1612
- $MSBuildArgs += " -restore"
1613
- $MSBuildArgs += " -maxCpuCount"
1610
+ $MSBuildArgs = @ ( " -noLogo" , " -maxCpuCount" , " -restore" , " $SourceCache \swift-installer-scripts\platforms\Windows\$FileName " )
1614
1611
foreach ($Property in $Properties.GetEnumerator ()) {
1615
1612
if ($Property.Value.Contains (" " )) {
1616
1613
$MSBuildArgs += " -p:$ ( $Property.Key ) =$ ( $Property.Value.Replace (' \' , ' \\' )) "
@@ -2190,8 +2187,12 @@ function Build-Runtime([Hashtable] $Platform) {
2190
2187
$PlatformDefines += @ {
2191
2188
LLVM_ENABLE_LIBCXX = " YES" ;
2192
2189
SWIFT_USE_LINKER = " lld" ;
2193
- # Clang[<18] doesn't provide the _Builtin_float module.
2194
- SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT = " YES" ;
2190
+ }
2191
+
2192
+ if ((Get-AndroidNDK ).ClangVersion -lt 18 ) {
2193
+ $PlatformDefines += @ {
2194
+ SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT = " YES" ;
2195
+ }
2195
2196
}
2196
2197
}
2197
2198
@@ -3133,14 +3134,14 @@ function Test-PackageManager() {
3133
3134
function Build-Installer ([Hashtable ] $Platform ) {
3134
3135
# TODO(hjyamauchi) Re-enable the swift-inspect and swift-docc builds
3135
3136
# when cross-compiling https://github.com/apple/swift/issues/71655
3136
- $INCLUDE_SWIFT_DOCC = if ($IsCrossCompiling ) { " false " } else { " true " }
3137
+ $INCLUDE_SWIFT_DOCC = if ($IsCrossCompiling ) { " False " } else { " True " }
3137
3138
3138
3139
$Properties = @ {
3139
3140
BundleFlavor = " offline" ;
3140
- TOOLCHAIN_ROOT = " $ ( $Platform.ToolchainInstallRoot ) \" ;
3141
+ ImageRoot = " $ ( Get-InstallDir $Platform ) \" ;
3141
3142
# When cross-compiling, bundle the second mimalloc redirect dll as a workaround for
3142
3143
# https://github.com/microsoft/mimalloc/issues/997
3143
- WORKAROUND_MIMALLOC_ISSUE_997 = if ($IsCrossCompiling ) { " true " } else { " false " };
3144
+ WORKAROUND_MIMALLOC_ISSUE_997 = if ($IsCrossCompiling ) { " True " } else { " False " };
3144
3145
INCLUDE_SWIFT_DOCC = $INCLUDE_SWIFT_DOCC ;
3145
3146
SWIFT_DOCC_BUILD = " $ ( Get-ProjectBinaryCache $HostPlatform DocC) \release" ;
3146
3147
SWIFT_DOCC_RENDER_ARTIFACT_ROOT = " ${SourceCache} \swift-docc-render-artifact" ;
@@ -3155,10 +3156,11 @@ function Build-Installer([Hashtable] $Platform) {
3155
3156
}
3156
3157
}
3157
3158
3159
+ $Properties [" Platforms" ] = " `" windows$ ( if ($Android ) { " ;android" }) `" " ;
3160
+ $Properties [" AndroidArchitectures" ] = " `" $ ( ($AndroidSDKPlatforms | ForEach-Object { $_.Architecture.LLVMName }) -Join " ;" ) `" "
3161
+ $Properties [" WindowsArchitectures" ] = " `" $ ( ($WindowsSDKPlatforms | ForEach-Object { $_.Architecture.LLVMName }) -Join " ;" ) `" "
3158
3162
foreach ($SDKPlatform in $WindowsSDKPlatforms ) {
3159
- $Properties [" INCLUDE_WINDOWS_$ ( $SDKPlatform.Architecture.VSName.ToUpperInvariant ()) _SDK" ] = " true"
3160
- $Properties [" PLATFORM_ROOT_$ ( $SDKPlatform.Architecture.VSName.ToUpperInvariant ()) " ] = " $ ( Get-PlatformRoot Windows) \" ;
3161
- $Properties [" SDK_ROOT_$ ( $SDKPlatform.Architecture.VSName.ToUpperInvariant ()) " ] = " $ ( Get-SwiftSDK Windows) \"
3163
+ $Properties [" WindowsRuntime$ ( $SDKPlatform.Architecture.ShortName.ToUpperInvariant ()) " ] = [IO.Path ]::Combine((Get-InstallDir $SDKPlatform ), " Runtimes" , " $ProductVersion " );
3162
3164
}
3163
3165
3164
3166
Build-WiXProject bundle\installer.wixproj - Platform $Platform - Bundle - Properties $Properties
@@ -3167,11 +3169,7 @@ function Build-Installer([Hashtable] $Platform) {
3167
3169
function Copy-BuildArtifactsToStage ([Hashtable ] $Platform ) {
3168
3170
Copy-File " $BinaryCache \$ ( $Platform.Triple ) \installer\Release\$ ( $Platform.Architecture.VSName ) \*.cab" $Stage
3169
3171
Copy-File " $BinaryCache \$ ( $Platform.Triple ) \installer\Release\$ ( $Platform.Architecture.VSName ) \*.msi" $Stage
3170
- foreach ($SDKPlatform in $WindowsSDKPlatforms ) {
3171
- Copy-File " $BinaryCache \$ ( $Platform.Triple ) \installer\Release\$ ( $SDKPlatform.Architecture.VSName ) \sdk.windows.$ ( $SDKPlatform.Architecture.VSName ) .cab" $Stage
3172
- Copy-File " $BinaryCache \$ ( $Platform.Triple ) \installer\Release\$ ( $SDKPlatform.Architecture.VSName ) \sdk.windows.$ ( $SDKPlatform.Architecture.VSName ) .msi" $Stage
3173
- Copy-File " $BinaryCache \$ ( $Platform.Triple ) \installer\Release\$ ( $SDKPlatform.Architecture.VSName ) \rtl.$ ( $SDKPlatform.Architecture.VSName ) .msm" $Stage
3174
- }
3172
+ Copy-File " $BinaryCache \$ ( $Platform.Triple ) \installer\Release\$ ( $Platform.Architecture.VSName ) \*.msm" $Stage
3175
3173
Copy-File " $BinaryCache \$ ( $Platform.Triple ) \installer\Release\$ ( $Platform.Architecture.VSName ) \installer.exe" $Stage
3176
3174
# Extract installer engine to ease code-signing on swift.org CI
3177
3175
if ($ToBatch ) {
@@ -3237,10 +3235,9 @@ if (-not $SkipBuild) {
3237
3235
Move-Item $_.FullName " $ ( Get-SwiftSDK Windows) \usr\lib\swift\windows\$ ( $Platform.Architecture.LLVMName ) \" | Out-Null
3238
3236
}
3239
3237
3240
- if ($Platform -eq $HostPlatform ) {
3241
- Copy-Directory " $ ( Get-SwiftSDK Windows) \usr\bin" " $ ( [IO.Path ]::Combine((Get-InstallDir $Platform ), " Runtimes" , $ProductVersion )) \usr"
3242
- }
3238
+ Copy-Directory " $ ( Get-SwiftSDK Windows) \usr\bin" " $ ( [IO.Path ]::Combine((Get-InstallDir $Platform ), " Runtimes" , $ProductVersion , " usr" )) "
3243
3239
}
3240
+
3244
3241
Install-Platform $WindowsSDKPlatforms Windows
3245
3242
Write-PlatformInfoPlist Windows
3246
3243
Write-SDKSettingsPlist Windows
0 commit comments