From 7ac6100a5af1d43efb812df3a536425a33d366e2 Mon Sep 17 00:00:00 2001 From: Abdelrahman Said Date: Sun, 23 Feb 2025 16:26:47 +0000 Subject: [PATCH] Add platform detection to Windows build --- build.ps1 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build.ps1 b/build.ps1 index 13f16ce..e1a93cb 100644 --- a/build.ps1 +++ b/build.ps1 @@ -7,6 +7,10 @@ $Compiler = "cl.exe" $GeneralFlags = "/Wall /WX /wd4996" $LibraryFlags = "/LD" +$Kernel = (Get-ChildItem Env:OS).Value +$Machine = (Get-ChildItem Env:PROCESSOR_ARCHITECTURE).Value +$Platform = "${Kernel}_${Machine}" + $IncludeDirs = Get-ChildItem -Path src -Recurse -Directory -ErrorAction SilentlyContinue -Force | %{$("/I " + '"' + $_.FullName + '"')} $SrcFiles = "src/wapp.c" @@ -21,7 +25,7 @@ If ($Release -eq $True) { $BuildType = "debug" } -$BuildDir = "./libwapp-build/windows-$BuildType" +$BuildDir = "./libwapp-build/${Platform}-${BuildType}" $ObjDir = "$BuildDir/objects" $OutDir = "$BuildDir/output" $TestsDir = "$BuildDir/tests"