deargui-vpl/scripts/build.ps1

41 lines
1.3 KiB
PowerShell

# Build script for simple-example project only
# Usage: .\scripts\build.ps1 [-BuildType Release|Debug]
param(
[Parameter(Position=0)]
[ValidateSet('Debug', 'Release')]
[string]$BuildType = 'Debug'
)
Write-Host "==========================================" -ForegroundColor Cyan
Write-Host "Building simple-example ($BuildType)" -ForegroundColor Cyan
Write-Host "==========================================" -ForegroundColor Cyan
Write-Host ""
# Build only the simple-example target
cmake --build build --config $BuildType --target simple-example
if ($LASTEXITCODE -eq 0) {
Write-Host ""
Write-Host "[OK] Build successful!" -ForegroundColor Green
Write-Host ""
Write-Host "Executable location:" -ForegroundColor Yellow
if ($BuildType -eq "Release") {
Write-Host " build\bin\simple-example.exe" -ForegroundColor White
} else {
Write-Host " build\bin\simple-example_d.exe" -ForegroundColor White
}
Write-Host ""
Write-Host "Run with:" -ForegroundColor Yellow
if ($BuildType -eq "Release") {
Write-Host " .\build\bin\simple-example.exe" -ForegroundColor White
} else {
Write-Host " .\build\bin\simple-example_d.exe" -ForegroundColor White
}
} else {
Write-Host ""
Write-Host "[ERROR] Build failed!" -ForegroundColor Red
exit 1
}