openvibers/source.openvibe.games Commits
Trim Windows target arch for Win32 DLL builds
Changes
nnew file mode 100644@@@ -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.@@@ -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:OPENVif ($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" }
new file mode 100644
new file mode 100644
@@ -0,0 +1,3 @@
@@ -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.
@@ -3,6 +3,10 @@ param(
@@ -3,6 +3,10 @@ param(
)
)
$ErrorActionPreference = "Stop"
$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 }
$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" }
$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
@@ -19,6 +23,10 @@ $script:OpenVibeTargetArch = if ($env:OPENVIBE_WINDOWS_TARGET_ARCH) { $env:OPENV
if ($script:OpenVibeTargetArch -notin @("x86", "x64")) {
if ($script:OpenVibeTargetArch -notin @("x86", "x64")) {
throw "OPENVIBE_WINDOWS_TARGET_ARCH must be x86 or x64, got '$script:OpenVibeTargetArch'"
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"
Write-Host "[openvibe-win] target arch=$script:OpenVibeTargetArch"
function Require($p, $msg) {
function Require($p, $msg) {
if (!(Test-Path $p)) { throw "$msg`nMissing: $p" }
if (!(Test-Path $p)) { throw "$msg`nMissing: $p" }