1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-23 16:24:02 +00:00
transmission/release/windows/build-zlib.ps1

23 lines
695 B
PowerShell
Raw Normal View History

#!/usr/bin/env pwsh
$global:ZlibVersion = '1.2.11'
$global:ZlibDeps = @()
function global:Build-Zlib([string] $PrefixDir, [string] $Arch, [string] $DepsPrefixDir) {
$Filename = "zlib-${ZlibVersion}.tar.gz"
$Url = "https://zlib.net/fossils/${Filename}"
$SourceDir = Invoke-DownloadAndUnpack $Url $Filename
$BuildDir = Join-Path $SourceDir .build
$ConfigOptions = @(
'-DCMAKE_BUILD_TYPE=RelWithDebInfo'
"-DCMAKE_INSTALL_PREFIX=${PrefixDir}"
"-DCMAKE_PREFIX_PATH=${DepsPrefixDir}"
)
Invoke-CMakeBuildAndInstall $SourceDir $BuildDir $ConfigOptions
Copy-Item -Path (Join-Path $BuildDir zlib.pdb) -Destination (Join-Path $PrefixDir bin)
}