This commit is contained in:
Abdelrahman Said 2025-02-16 14:53:29 +00:00
parent f60442bfcf
commit ca2b1cbf23

View File

@ -1,5 +1,5 @@
Param( Param(
[switch]$Release [switch]$Release
) )
$Compiler = "cl.exe" $Compiler = "cl.exe"
@ -14,11 +14,11 @@ $TestIncludeDirs = Get-ChildItem -Path tests -Recurse -Directory -ErrorAction Si
$TestSrcFiles = Get-ChildItem -Path tests -Recurse -Filter *.c -ErrorAction SilentlyContinue -Force | %{$('"' + $_.FullName + '"')} $TestSrcFiles = Get-ChildItem -Path tests -Recurse -Filter *.c -ErrorAction SilentlyContinue -Force | %{$('"' + $_.FullName + '"')}
If ($Release -eq $True) { If ($Release -eq $True) {
$GeneralFlags += " /O2 /Og" $GeneralFlags += " /O2 /Og"
$BuildType = "release" $BuildType = "release"
} Else { } Else {
$GeneralFlags += " /Zi /Od /fsanitize=address" $GeneralFlags += " /Zi /Od /fsanitize=address"
$BuildType = "debug" $BuildType = "debug"
} }
$BuildDir = "./libwapp-build/windows-$BuildType" $BuildDir = "./libwapp-build/windows-$BuildType"
@ -34,7 +34,7 @@ $TestOutBasename = "wapptest"
$TestOutputs = "/Fo:$TestsDir/ /Fe:$TestsDir/$TestOutBasename" $TestOutputs = "/Fo:$TestsDir/ /Fe:$TestsDir/$TestOutBasename"
If (Test-Path $BuildDir) { If (Test-Path $BuildDir) {
Remove-Item $BuildDir -Recurse -Force Remove-Item $BuildDir -Recurse -Force
} }
mkdir -p $ObjDir > $null mkdir -p $ObjDir > $null
@ -50,8 +50,8 @@ $Status = $LASTEXITCODE
Remove-Item $TestsDir -Recurse -Force Remove-Item $TestsDir -Recurse -Force
If ($Status -ne 0) { If ($Status -ne 0) {
Write-Error "Tests failed" Write-Error "Tests failed"
Exit 1 Exit 1
} }
# Build library # Build library