Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 28 additions & 12 deletions utils/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,9 @@ function Copy-File($Src, $Dst) {
Write-Output "copy /Y `"$Src`" `"$Dst`""
} else {
New-Item -ItemType Directory -ErrorAction Ignore $DstDir | Out-Null
Copy-Item -Force $Src $Dst
Copy-Item -Force `
-Path $Src `
-Destination $Dst
}
}

Expand All @@ -804,7 +806,9 @@ function Copy-Directory($Src, $Dst) {
Write-Output "copy /Y `"$Src`" `"$Dst`""
} else {
New-Item -ItemType Directory -ErrorAction Ignore $Dst | Out-Null
Copy-Item -Force -Recurse $Src $Dst
Copy-Item -Force -Recurse `
-Path $Src `
-Destination $Dst
}
}

Expand Down Expand Up @@ -2032,14 +2036,20 @@ function Test-Compilers([Hashtable] $Platform, [string] $Variant, [switch] $Test

# Transitive dependency of _lldb.pyd
$RuntimeBinaryCache = Get-ProjectBinaryCache $BuildPlatform Runtime
Copy-Item $RuntimeBinaryCache\bin\swiftCore.dll "$(Get-ProjectBinaryCache $BuildPlatform Compilers)\lib\site-packages\lldb"
Copy-Item `
-Path $RuntimeBinaryCache\bin\swiftCore.dll `
-Destination "$(Get-ProjectBinaryCache $BuildPlatform Compilers)\lib\site-packages\lldb"

# Runtime dependencies of repl_swift.exe
$SwiftRTSubdir = "lib\swift\windows"
Write-Host "Copying '$RuntimeBinaryCache\$SwiftRTSubdir\$($Platform.Architecture.LLVMName)\swiftrt.obj' to '$(Get-ProjectBinaryCache $BuildPlatform Compilers)\$SwiftRTSubdir'"
Copy-Item "$RuntimeBinaryCache\$SwiftRTSubdir\$($Platform.Architecture.LLVMName)\swiftrt.obj" "$(Get-ProjectBinaryCache $BuildPlatform Compilers)\$SwiftRTSubdir"
Copy-Item `
-Path "$RuntimeBinaryCache\$SwiftRTSubdir\$($Platform.Architecture.LLVMName)\swiftrt.obj" `
-Destination "$(Get-ProjectBinaryCache $BuildPlatform Compilers)\$SwiftRTSubdir"
Write-Host "Copying '$RuntimeBinaryCache\bin\swiftCore.dll' to '$(Get-ProjectBinaryCache $BuildPlatform Compilers)\bin'"
Copy-Item "$RuntimeBinaryCache\bin\swiftCore.dll" "$(Get-ProjectBinaryCache $BuildPlatform Compilers)\bin"
Copy-Item `
-Path "$RuntimeBinaryCache\bin\swiftCore.dll" `
-Destination "$(Get-ProjectBinaryCache $BuildPlatform Compilers)\bin"

$TestingDefines += @{
LLDB_INCLUDE_TESTS = "YES";
Expand Down Expand Up @@ -2115,7 +2125,9 @@ function Build-mimalloc() {
$BuildSuffix = if ($BuildPlatform -eq $KnownPlatforms["WindowsX64"]) { "" } else { "-arm64" }

foreach ($item in "mimalloc.dll", "mimalloc-redirect$HostSuffix.dll") {
Copy-Item -Path "$BinaryCache\$($Platform.Triple)\mimalloc\bin\$item" -Destination "$($Platform.ToolchainInstallRoot)\usr\bin\"
Copy-Item `
-Path "$BinaryCache\$($Platform.Triple)\mimalloc\bin\$item" `
-Destination "$($Platform.ToolchainInstallRoot)\usr\bin\"
}

# TODO: should we split this out into its own function?
Expand Down Expand Up @@ -3449,16 +3461,20 @@ function Install-HostToolchain() {

# Restructure _InternalSwiftScan (keep the original one for the installer)
Copy-Item -Force `
"$($HostPlatform.ToolchainInstallRoot)\usr\lib\swift\_InternalSwiftScan" `
"$($HostPlatform.ToolchainInstallRoot)\usr\include"
-Path "$($HostPlatform.ToolchainInstallRoot)\usr\lib\swift\_InternalSwiftScan" `
-Destination "$($HostPlatform.ToolchainInstallRoot)\usr\include"
Copy-Item -Force `
"$($HostPlatform.ToolchainInstallRoot)\usr\lib\swift\windows\_InternalSwiftScan.lib" `
"$($HostPlatform.ToolchainInstallRoot)\usr\lib"
-Path "$($HostPlatform.ToolchainInstallRoot)\usr\lib\swift\windows\_InternalSwiftScan.lib" `
-Destination "$($HostPlatform.ToolchainInstallRoot)\usr\lib"

# Switch to swift-driver
$SwiftDriver = ([IO.Path]::Combine((Get-ProjectBinaryCache $HostPlatform Driver), "bin", "swift-driver.exe"))
Copy-Item -Force $SwiftDriver "$($HostPlatform.ToolchainInstallRoot)\usr\bin\swift.exe"
Copy-Item -Force $SwiftDriver "$($HostPlatform.ToolchainInstallRoot)\usr\bin\swiftc.exe"
Copy-Item -Force `
-Path $SwiftDriver `
-Destination "$($HostPlatform.ToolchainInstallRoot)\usr\bin\swift.exe"
Copy-Item -Force `
-Path $SwiftDriver `
-Destination "$($HostPlatform.ToolchainInstallRoot)\usr\bin\swiftc.exe"
}

function Build-Inspect([Hashtable] $Platform) {
Expand Down