-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-windows.ps1
35 lines (29 loc) · 1002 Bytes
/
build-windows.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Param(
[string]$Version
)
# check env var CPU_OR_CUDA
if ($env:CPU_OR_CUDA -eq $null) {
Write-Host "Please set env var CPU_OR_CUDA to 'cpu', 'clblast' or the CUDA version you want to use"
exit
}
$cmakeArgs = @()
if ($env:CPU_OR_CUDA -eq "cpu") {
$cmakeArgs += ("-DWHISPERCPP_WITH_CUDA=OFF")
$zipFileName = "whispercpp-windows-cpu-$Version.zip"
} elseif ($env:CPU_OR_CUDA -eq "clblast") {
$cmakeArgs += ("-DWHISPERCPP_WITH_CUDA=OFF", "-DWHISPERCPP_WITH_CLBLAST=ON")
$zipFileName = "whispercpp-windows-clblast-$Version.zip"
} else {
$cmakeArgs += (
"-DWHISPERCPP_WITH_CUDA=ON",
"-DCUDA_TOOLKIT_ROOT_DIR=$env:CUDA_TOOLKIT_ROOT_DIR"
)
$zipFileName = "whispercpp-windows-cuda$env:CPU_OR_CUDA-$Version.zip"
}
# configure
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release @cmakeArgs
cmake --build build --config Release
# install
cmake --install build
# compress the release folder
Compress-Archive -Force -Path release -DestinationPath $zipFileName