Skip to content

Commit 16b71df

Browse files
authored
Merge pull request swiftlang#83867 from mhegazy/mimalloc-patch-fix
Fix order of building mimalloc with `-IncludeNoAsserts`
2 parents 3728c77 + effe6d6 commit 16b71df

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
@@ -2254,15 +2254,24 @@ function Build-mimalloc() {
22542254
Invoke-Program $msbuild "$SourceCache\mimalloc\ide\vs2022\mimalloc-override-dll.vcxproj" @MSBuildArgs "-p:IntDir=$BinaryCache\$($Platform.Triple)\mimalloc\mimalloc-override-dll\"
22552255

22562256
$HostSuffix = if ($Platform -eq $KnownPlatforms["WindowsX64"]) { "" } else { "-arm64" }
2257-
$BuildSuffix = if ($BuildPlatform -eq $KnownPlatforms["WindowsX64"]) { "" } else { "-arm64" }
22582257

22592258
foreach ($item in "mimalloc.dll", "mimalloc-redirect$HostSuffix.dll") {
22602259
Copy-Item `
22612260
-Path "$BinaryCache\$($Platform.Triple)\mimalloc\bin\$item" `
22622261
-Destination "$($Platform.ToolchainInstallRoot)\usr\bin\"
22632262
}
2263+
}
2264+
2265+
function Patch-mimalloc() {
2266+
[CmdletBinding(PositionalBinding = $false)]
2267+
param
2268+
(
2269+
[Parameter(Position = 0, Mandatory = $true)]
2270+
[hashtable]$Platform
2271+
)
2272+
2273+
$BuildSuffix = if ($BuildPlatform -eq $KnownPlatforms["WindowsX64"]) { "" } else { "-arm64" }
22642274

2265-
# TODO: should we split this out into its own function?
22662275
$Tools = @(
22672276
"swift.exe",
22682277
"swiftc.exe",
@@ -4069,6 +4078,10 @@ if (-not $SkipBuild -and -not $IsCrossCompiling) {
40694078
Invoke-BuildStep Build-DocC $HostPlatform
40704079
}
40714080

4081+
if (-not $SkipBuild) {
4082+
Invoke-BuildStep Patch-mimalloc $HostPlatform
4083+
}
4084+
40724085
if (-not $SkipPackaging) {
40734086
Invoke-BuildStep Build-Installer $HostPlatform
40744087
}

0 commit comments

Comments
 (0)