mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-05-18 20:57:00 +02:00
[tools] MSVC environment loader, POSIX vulkan/MSVC install scripts (#2993)
* also move install-vulkan-sdk.ps1 to tools Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2993 Reviewed-by: crueter <crueter@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev> Co-authored-by: Caio Oliveira <caiooliveirafarias0@gmail.com> Co-committed-by: Caio Oliveira <caiooliveirafarias0@gmail.com>
This commit is contained in:
parent
680384f7b8
commit
7e730a121b
9 changed files with 595 additions and 29 deletions
42
tools/windows/load-msvc-env.ps1
Normal file
42
tools/windows/load-msvc-env.ps1
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
$osArch = $env:PROCESSOR_ARCHITECTURE
|
||||
|
||||
switch ($osArch) {
|
||||
"AMD64" { $arch = "x64" }
|
||||
"ARM64" { $arch = "arm64" }
|
||||
default {
|
||||
Write-Error "load-msvc-env.ps1: Unsupported architecture: $osArch"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
|
||||
|
||||
if (!(Test-Path $vswhere)) {
|
||||
Write-Error "load-msvc-env.ps1: vswhere not found"
|
||||
exit 1
|
||||
}
|
||||
|
||||
$vs = & $vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
|
||||
|
||||
if (-not $vs) {
|
||||
Write-Error "load-msvc-env.ps1: Visual Studio (with Desktop development with C++) not found"
|
||||
exit 1
|
||||
}
|
||||
|
||||
$bat = "$vs\VC\Auxiliary\Build\vcvarsall.bat"
|
||||
|
||||
if (!(Test-Path $bat)) {
|
||||
Write-Error "load-msvc-env.ps1: (vcvarsall.bat) not found"
|
||||
exit 1
|
||||
}
|
||||
|
||||
cmd /c "`"$bat`" $arch && set" | ForEach-Object {
|
||||
if ($_ -match "^(.*?)=(.*)$") {
|
||||
[Environment]::SetEnvironmentVariable($matches[1], $matches[2], 'Process')
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host "load-msvc-env.ps1: MSVC environment loaded for $arch ($vs)"
|
||||
Loading…
Add table
Add a link
Reference in a new issue