openvibers/source.openvibe.games Commits

Trim Windows target arch for Win32 DLL builds

CO Copilot committed 29 Jun 2026 · 5382adb2b2 · 2 files, +11 −0


Changes

ddiff --git a/docs/WINDOWS_TARGET_ARCH_TRIM.md b/docs/WINDOWS_TARGET_ARCH_TRIM.md
nnew file mode 100644
iindex 0000000..f5c346b
---- /dev/null
++++ b/docs/WINDOWS_TARGET_ARCH_TRIM.md
@@@ -0,0 +1,3 @@
++# Windows target arch trim fix
++
++The Win32 GitHub Actions build relaunches through `vcvars32.bat`. The target arch value can survive as `x86 ` with a trailing space depending on how the command string/env was composed. `tools/build-sdk-windows.ps1` now trims `OPENVIBE_WINDOWS_TARGET_ARCH` before validation and normalizes it after validation so Win32 builds do not fail before project generation.
ddiff --git a/tools/build-sdk-windows.ps1 b/tools/build-sdk-windows.ps1
iindex fbb77b6..3112994 100644
---- a/tools/build-sdk-windows.ps1
++++ b/tools/build-sdk-windows.ps1
@@@ -3,6 +3,10 @@ param(
)
$ErrorActionPreference = "Stop"
++# OPENVIBE_TARGET_ARCH_TRIM_GUARD
++if ($env:OPENVIBE_WINDOWS_TARGET_ARCH) { $env:OPENVIBE_WINDOWS_TARGET_ARCH = $env:OPENVIBE_WINDOWS_TARGET_ARCH.Trim() }
++if ($script:TargetArch) { $script:TargetArch = ([string]$script:TargetArch).Trim() }
++
$Root = if ($env:OPENVIBE_ROOT) { (Resolve-Path $env:OPENVIBE_ROOT).Path } else { (Resolve-Path (Join-Path $PSScriptRoot "..")).Path }
$Sdk = if ($env:OPENVIBE_SDK) { $env:OPENVIBE_SDK } else { Join-Path $Root "engine/source-sdk-2013" }
@@@ -19,6 +23,10 @@ $script:OpenVibeTargetArch = if ($env:OPENVIBE_WINDOWS_TARGET_ARCH) { $env:OPENV
if ($script:OpenVibeTargetArch -notin @("x86", "x64")) {
throw "OPENVIBE_WINDOWS_TARGET_ARCH must be x86 or x64, got '$script:OpenVibeTargetArch'"
}
++# OPENVIBE_TARGET_ARCH_NORMALIZE_AFTER_VALIDATE
++$script:TargetArch = ([string]$script:TargetArch).Trim()
++$env:OPENVIBE_WINDOWS_TARGET_ARCH = $script:TargetArch
++
Write-Host "[openvibe-win] target arch=$script:OpenVibeTargetArch"
function Require($p, $msg) {
if (!(Test-Path $p)) { throw "$msg`nMissing: $p" }