-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.ps1
More file actions
38 lines (31 loc) · 953 Bytes
/
build.ps1
File metadata and controls
38 lines (31 loc) · 953 Bytes
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
36
37
38
# simple windows build script that i wrote in like 2 minutes
# definitely could be improved but it works good enough
$errorOccurred = $false
if (Test-Path "build") {
Write-Host "Would you like to remove the existing build directory? (y/n)"
$choice = (Read-Host).Trim().ToLower()
if ($choice -eq "y") {
Remove-Item -Recurse -Force "build"
} elseif ($choice -eq "n") {
Write-Host "Exiting..."
exit
}
}
New-Item -ItemType Directory -Path "build" -ErrorAction SilentlyContinue | Out-Null
Push-Location "build"
try {
$env:PATH = "C:\Qt\Tools\mingw1310_64\bin;C:\Qt\Tools\CMake_64\bin;C:\Qt\Tools\Ninja;$env:PATH"
cmake -G "MinGW Makefiles" ..
mingw32-make
} catch {
Write-Host -ForegroundColor Red "An unexpected error occurred during the build process: $_"
$errorOccurred = $true
}
finally {
Pop-Location
if ($errorOccurred) {
exit 1
} else {
exit 0
}
}