1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-27 01:57:52 +00:00
transmission/release/windows/build-zlib.ps1

22 lines
695 B
PowerShell

#!/usr/bin/env pwsh
$global:ZlibVersion = '1.2.13'
$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)
}