12 lines
663 B
PowerShell
12 lines
663 B
PowerShell
$ErrorActionPreference = 'Stop'
|
|
$tools = Join-Path $PSScriptRoot '.tools'
|
|
New-Item -ItemType Directory -Force $tools | Out-Null
|
|
$archive = Join-Path $tools 'w64devkit.exe'
|
|
$uri = 'https://github.com/skeeto/w64devkit/releases/download/v2.10.1/w64devkit-x64-2.10.1.7z.exe'
|
|
$expected = 'ADD1EDF984CE4D473CFEB7C52E0AB38DB73A855BBA6C7F564D5E16648EB2896A'
|
|
if (!(Test-Path $archive)) { Invoke-WebRequest $uri -OutFile $archive }
|
|
if ((Get-FileHash $archive -Algorithm SHA256).Hash -ne $expected) { throw 'Toolchain checksum mismatch' }
|
|
& $archive -y "-o$tools"
|
|
if ($LASTEXITCODE) { throw 'Toolchain extraction failed' }
|
|
Write-Host 'Compiler ready. Run .\build.ps1 -Test'
|