Files
runner-images/images/windows/scripts/build/Install-Mingw64.ps1
T

40 lines
1.4 KiB
PowerShell
Raw Normal View History

################################################################################
2020-05-19 13:16:59 +03:00
## File: Install-Mingw64.ps1
2020-07-10 14:29:54 +03:00
## Desc: Install GNU tools for Windows
################################################################################
# Install version specified in the toolset
$version = (Get-ToolsetContent).mingw.version
$runtime = (Get-ToolsetContent).mingw.runtime
$("mingw32", "mingw64") | ForEach-Object {
if ($_ -eq "mingw32") {
$arch = "i686"
$threads = "posix"
$exceptions = "dwarf"
} elseif ($_ -eq "mingw64") {
$arch = "x86_64"
$threads = "posix"
$exceptions = "seh"
} else {
throw "Unknown architecture $_"
2023-12-04 10:50:53 +01:00
}
2024-11-29 11:08:29 +01:00
$url = Resolve-GithubReleaseAssetUrl `
-Repo "niXman/mingw-builds-binaries" `
-Version "$version" `
-Asset "$arch-*-release-$threads-$exceptions-$runtime-*.7z"
2023-12-04 10:50:53 +01:00
$packagePath = Invoke-DownloadWithRetry $url
Expand-7ZipArchive -Path $packagePath -DestinationPath "C:\"
# Make a copy of mingw-make.exe to make.exe, which is a more discoverable name
# and so the same command line can be used on Windows as on macOS and Linux
$path = "C:\$_\bin\mingw32-make.exe" | Get-Item
Copy-Item -Path $path -Destination (Join-Path $path.Directory 'make.exe')
2023-12-04 10:50:53 +01:00
}
Add-MachinePathItem "C:\mingw64\bin"
2020-07-10 14:29:54 +03:00
Invoke-PesterTests -TestFile "Tools" -TestName "Mingw64"