@@ -537,18 +537,18 @@ function Get-PythonScriptsPath {
537
537
538
538
function Get-InstallDir ([Hashtable ] $Platform ) {
539
539
if ($Platform -eq $HostPlatform ) {
540
- $ProgramFilesName = " Program Files"
541
- } elseif ( $Platform -eq $KnownPlatforms [ " WindowsX86 " ]) {
542
- $ProgramFilesName = " Program Files (x86) "
543
- } elseif (( $HostPlatform -eq $KnownPlatforms [ " WindowsARM64 " ]) -and ( $Platform -eq $KnownPlatforms [ " WindowsX64 " ])) {
544
- # x64 programs actually install under "Program Files" on arm64,
545
- # but this would conflict with the native installation.
546
- $ProgramFilesName = " Program Files (Amd64)"
547
- } else {
548
- # arm64 cannot be installed on x64
549
- return $null
540
+ return [ IO.Path ]::Combine( " $ImageRoot \ " , " Program Files" , " Swift " )
541
+ }
542
+ if ( $Platform -eq $KnownPlatforms [ " WindowsARM64 " ]) {
543
+ return [ IO.Path ]::Combine( " $ImageRoot \ " , " Program Files (Arm64) " , " Swift " )
544
+ }
545
+ if ( $Platform -eq $KnownPlatforms [ " WindowsX64 " ]) {
546
+ return [ IO.Path ]::Combine( " $ImageRoot \ " , " Program Files (Amd64)" , " Swift " )
547
+ }
548
+ if ( $Platform -eq $KnownPlatforms [ " WindowsX86 " ]) {
549
+ return [ IO.Path ]::Combine( " $ImageRoot \ " , " Program Files (x86) " , " Swift " )
550
550
}
551
- return " $ImageRoot \ $ProgramFilesName \Swift "
551
+ throw " Unknown Platform "
552
552
}
553
553
554
554
# For dev productivity, install the host toolchain directly using CMake.
@@ -1601,10 +1601,7 @@ function Build-WiXProject() {
1601
1601
Add-KeyValueIfNew $Properties ProductArchitecture $Platform.Architecture.VSName
1602
1602
Add-KeyValueIfNew $Properties ProductVersion $ProductVersionArg
1603
1603
1604
- $MSBuildArgs = @ (" $SourceCache \swift-installer-scripts\platforms\Windows\$FileName " )
1605
- $MSBuildArgs += " -noLogo"
1606
- $MSBuildArgs += " -restore"
1607
- $MSBuildArgs += " -maxCpuCount"
1604
+ $MSBuildArgs = @ ( " -noLogo" , " -maxCpuCount" , " -restore" , " $SourceCache \swift-installer-scripts\platforms\Windows\$FileName " )
1608
1605
foreach ($Property in $Properties.GetEnumerator ()) {
1609
1606
if ($Property.Value.Contains (" " )) {
1610
1607
$MSBuildArgs += " -p:$ ( $Property.Key ) =$ ( $Property.Value.Replace (' \' , ' \\' )) "
@@ -2184,8 +2181,12 @@ function Build-Runtime([Hashtable] $Platform) {
2184
2181
$PlatformDefines += @ {
2185
2182
LLVM_ENABLE_LIBCXX = " YES" ;
2186
2183
SWIFT_USE_LINKER = " lld" ;
2187
- # Clang[<18] doesn't provide the _Builtin_float module.
2188
- SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT = " YES" ;
2184
+ }
2185
+
2186
+ if ((Get-AndroidNDK ).ClangVersion -lt 18 ) {
2187
+ $PlatformDefines += @ {
2188
+ SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT = " YES" ;
2189
+ }
2189
2190
}
2190
2191
}
2191
2192
@@ -3127,14 +3128,14 @@ function Test-PackageManager() {
3127
3128
function Build-Installer ([Hashtable ] $Platform ) {
3128
3129
# TODO(hjyamauchi) Re-enable the swift-inspect and swift-docc builds
3129
3130
# when cross-compiling https://github.com/apple/swift/issues/71655
3130
- $INCLUDE_SWIFT_DOCC = if ($IsCrossCompiling ) { " false " } else { " true " }
3131
+ $INCLUDE_SWIFT_DOCC = if ($IsCrossCompiling ) { " False " } else { " True " }
3131
3132
3132
3133
$Properties = @ {
3133
3134
BundleFlavor = " offline" ;
3134
- TOOLCHAIN_ROOT = " $ ( $Platform.ToolchainInstallRoot ) \" ;
3135
+ ImageRoot = " $ ( Get-InstallDir $Platform ) \" ;
3135
3136
# When cross-compiling, bundle the second mimalloc redirect dll as a workaround for
3136
3137
# https://github.com/microsoft/mimalloc/issues/997
3137
- WORKAROUND_MIMALLOC_ISSUE_997 = if ($IsCrossCompiling ) { " true " } else { " false " };
3138
+ WORKAROUND_MIMALLOC_ISSUE_997 = if ($IsCrossCompiling ) { " True " } else { " False " };
3138
3139
INCLUDE_SWIFT_DOCC = $INCLUDE_SWIFT_DOCC ;
3139
3140
SWIFT_DOCC_BUILD = " $ ( Get-ProjectBinaryCache $HostPlatform DocC) \release" ;
3140
3141
SWIFT_DOCC_RENDER_ARTIFACT_ROOT = " ${SourceCache} \swift-docc-render-artifact" ;
@@ -3149,10 +3150,11 @@ function Build-Installer([Hashtable] $Platform) {
3149
3150
}
3150
3151
}
3151
3152
3153
+ $Properties [" Platforms" ] = " `" windows$ ( if ($Android ) { " ;android" }) `" " ;
3154
+ $Properties [" AndroidArchitectures" ] = " `" $ ( ($AndroidSDKPlatforms | ForEach-Object { $_.Architecture.LLVMName }) -Join " ;" ) `" "
3155
+ $Properties [" WindowsArchitectures" ] = " `" $ ( ($WindowsSDKPlatforms | ForEach-Object { $_.Architecture.LLVMName }) -Join " ;" ) `" "
3152
3156
foreach ($SDKPlatform in $WindowsSDKPlatforms ) {
3153
- $Properties [" INCLUDE_WINDOWS_$ ( $SDKPlatform.Architecture.VSName.ToUpperInvariant ()) _SDK" ] = " true"
3154
- $Properties [" PLATFORM_ROOT_$ ( $SDKPlatform.Architecture.VSName.ToUpperInvariant ()) " ] = " $ ( Get-PlatformRoot Windows) \" ;
3155
- $Properties [" SDK_ROOT_$ ( $SDKPlatform.Architecture.VSName.ToUpperInvariant ()) " ] = " $ ( Get-SwiftSDK Windows) \"
3157
+ $Properties [" WindowsRuntime$ ( $SDKPlatform.Architecture.ShortName.ToUpperInvariant ()) " ] = [IO.Path ]::Combine((Get-InstallDir $SDKPlatform ), " Runtimes" , " $ProductVersion " );
3156
3158
}
3157
3159
3158
3160
Build-WiXProject bundle\installer.wixproj - Platform $Platform - Bundle - Properties $Properties
@@ -3161,11 +3163,7 @@ function Build-Installer([Hashtable] $Platform) {
3161
3163
function Copy-BuildArtifactsToStage ([Hashtable ] $Platform ) {
3162
3164
Copy-File " $BinaryCache \$ ( $Platform.Triple ) \installer\Release\$ ( $Platform.Architecture.VSName ) \*.cab" $Stage
3163
3165
Copy-File " $BinaryCache \$ ( $Platform.Triple ) \installer\Release\$ ( $Platform.Architecture.VSName ) \*.msi" $Stage
3164
- foreach ($SDKPlatform in $WindowsSDKPlatforms ) {
3165
- Copy-File " $BinaryCache \$ ( $Platform.Triple ) \installer\Release\$ ( $SDKPlatform.Architecture.VSName ) \sdk.windows.$ ( $SDKPlatform.Architecture.VSName ) .cab" $Stage
3166
- Copy-File " $BinaryCache \$ ( $Platform.Triple ) \installer\Release\$ ( $SDKPlatform.Architecture.VSName ) \sdk.windows.$ ( $SDKPlatform.Architecture.VSName ) .msi" $Stage
3167
- Copy-File " $BinaryCache \$ ( $Platform.Triple ) \installer\Release\$ ( $SDKPlatform.Architecture.VSName ) \rtl.$ ( $SDKPlatform.Architecture.VSName ) .msm" $Stage
3168
- }
3166
+ Copy-File " $BinaryCache \$ ( $Platform.Triple ) \installer\Release\$ ( $Platform.Architecture.VSName ) \*.msm" $Stage
3169
3167
Copy-File " $BinaryCache \$ ( $Platform.Triple ) \installer\Release\$ ( $Platform.Architecture.VSName ) \installer.exe" $Stage
3170
3168
# Extract installer engine to ease code-signing on swift.org CI
3171
3169
if ($ToBatch ) {
@@ -3228,10 +3226,9 @@ if (-not $SkipBuild) {
3228
3226
Move-Item $_.FullName " $ ( Get-SwiftSDK Windows) \usr\lib\swift\windows\$ ( $Platform.Architecture.LLVMName ) \" | Out-Null
3229
3227
}
3230
3228
3231
- if ($Platform -eq $HostPlatform ) {
3232
- Copy-Directory " $ ( Get-SwiftSDK Windows) \usr\bin" " $ ( [IO.Path ]::Combine((Get-InstallDir $Platform ), " Runtimes" , $ProductVersion )) \usr"
3233
- }
3229
+ Copy-Directory " $ ( Get-SwiftSDK Windows) \usr\bin" " $ ( [IO.Path ]::Combine((Get-InstallDir $Platform ), " Runtimes" , $ProductVersion , " usr" )) "
3234
3230
}
3231
+
3235
3232
Install-Platform $WindowsSDKPlatforms Windows
3236
3233
Write-PlatformInfoPlist Windows
3237
3234
Write-SDKSettingsPlist Windows
0 commit comments