Skip to content

Commit effe6d6

Browse files
committed
Split Build-mimalloc into two functions
1 parent 50be389 commit effe6d6

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

utils/build.ps1

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2222,15 +2222,24 @@ function Build-mimalloc() {
22222222
Invoke-Program $msbuild "$SourceCache\mimalloc\ide\vs2022\mimalloc-override-dll.vcxproj" @MSBuildArgs "-p:IntDir=$BinaryCache\$($Platform.Triple)\mimalloc\mimalloc-override-dll\"
22232223

22242224
$HostSuffix = if ($Platform -eq $KnownPlatforms["WindowsX64"]) { "" } else { "-arm64" }
2225-
$BuildSuffix = if ($BuildPlatform -eq $KnownPlatforms["WindowsX64"]) { "" } else { "-arm64" }
22262225

22272226
foreach ($item in "mimalloc.dll", "mimalloc-redirect$HostSuffix.dll") {
22282227
Copy-Item `
22292228
-Path "$BinaryCache\$($Platform.Triple)\mimalloc\bin\$item" `
22302229
-Destination "$($Platform.ToolchainInstallRoot)\usr\bin\"
22312230
}
2231+
}
2232+
2233+
function Patch-mimalloc() {
2234+
[CmdletBinding(PositionalBinding = $false)]
2235+
param
2236+
(
2237+
[Parameter(Position = 0, Mandatory = $true)]
2238+
[hashtable]$Platform
2239+
)
2240+
2241+
$BuildSuffix = if ($BuildPlatform -eq $KnownPlatforms["WindowsX64"]) { "" } else { "-arm64" }
22322242

2233-
# TODO: should we split this out into its own function?
22342243
$Tools = @(
22352244
"swift.exe",
22362245
"swiftc.exe",
@@ -4030,6 +4039,10 @@ if (-not $SkipBuild -and -not $IsCrossCompiling) {
40304039
Invoke-BuildStep Build-DocC $HostPlatform
40314040
}
40324041

4042+
if (-not $SkipBuild) {
4043+
Invoke-BuildStep Patch-mimalloc $HostPlatform
4044+
}
4045+
40334046
if (-not $SkipPackaging) {
40344047
Invoke-BuildStep Build-Installer $HostPlatform
40354048
}

0 commit comments

Comments
 (0)