mirror of
https://github.com/mitch030504/Wiicompiled_VR_Frame.git
synced 2026-10-06 05:00:27 +02:00
Merge pull request #77 from patchzyy/Fix-unsupported-locale
Fix paranthesees
This commit is contained in:
2 files changed
+42
-4
No files matched your search
@@ -151,9 +151,10 @@ if ($Profile -ne 'both' -and -not [string]::IsNullOrWhiteSpace($BaseOutputDirect
|
|||||||
throw '-BaseOutputDirectory is valid only with -Profile both.'
|
throw '-BaseOutputDirectory is valid only with -Profile both.'
|
||||||
}
|
}
|
||||||
$translator = Join-Path $Toolkit 'Translator\Translator.Cli.exe'
|
$translator = Join-Path $Toolkit 'Translator\Translator.Cli.exe'
|
||||||
$cmake = Join-Path $Toolkit 'CMake\bin\cmake.exe'
|
$toolchain = Get-MkwShellSafeToolchainRoot $Toolkit
|
||||||
$ninja = Join-Path $Toolkit 'Ninja\ninja.exe'
|
$cmake = Join-Path $toolchain 'CMake\bin\cmake.exe'
|
||||||
$toolchainBin = Join-Path $Toolkit 'llvm-mingw\bin'
|
$ninja = Join-Path $toolchain 'Ninja\ninja.exe'
|
||||||
|
$toolchainBin = Join-Path $toolchain 'llvm-mingw\bin'
|
||||||
$cc = Join-Path $toolchainBin 'x86_64-w64-mingw32-clang.exe'
|
$cc = Join-Path $toolchainBin 'x86_64-w64-mingw32-clang.exe'
|
||||||
$cxx = Join-Path $toolchainBin 'x86_64-w64-mingw32-clang++.exe'
|
$cxx = Join-Path $toolchainBin 'x86_64-w64-mingw32-clang++.exe'
|
||||||
$windres = Join-Path $toolchainBin 'x86_64-w64-mingw32-windres.exe'
|
$windres = Join-Path $toolchainBin 'x86_64-w64-mingw32-windres.exe'
|
||||||
@@ -203,7 +204,7 @@ if ($Parallel -gt 0) {
|
|||||||
$oldPath = $env:PATH
|
$oldPath = $env:PATH
|
||||||
$oldDotnet = $env:DOTNET_ROOT
|
$oldDotnet = $env:DOTNET_ROOT
|
||||||
try {
|
try {
|
||||||
$env:PATH = Get-MkwToolchainPath $Toolkit
|
$env:PATH = Get-MkwToolchainPath $toolchain
|
||||||
Remove-Item Env:DOTNET_ROOT -ErrorAction SilentlyContinue
|
Remove-Item Env:DOTNET_ROOT -ErrorAction SilentlyContinue
|
||||||
Push-Location $Workspace
|
Push-Location $Workspace
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -40,6 +40,43 @@ function Get-MkwToolchainPath([string]$ToolchainRoot) {
|
|||||||
) -join ';')
|
) -join ';')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function Get-MkwShellSafeToolchainRoot([string]$ToolchainRoot) {
|
||||||
|
if ([string]::IsNullOrWhiteSpace($ToolchainRoot)) { throw 'A toolchain root is required.' }
|
||||||
|
$full = [IO.Path]::GetFullPath($ToolchainRoot)
|
||||||
|
# A drive root keeps its separator: "C:" is relative to the current directory on that drive.
|
||||||
|
if ($full -ne [IO.Path]::GetPathRoot($full)) { $full = $full.TrimEnd('\') }
|
||||||
|
if ($full -notmatch '[()&^%!]') { return $full }
|
||||||
|
|
||||||
|
$sha = [Security.Cryptography.SHA256]::Create()
|
||||||
|
try {
|
||||||
|
$bytes = $sha.ComputeHash([Text.Encoding]::UTF8.GetBytes($full.ToLowerInvariant()))
|
||||||
|
} finally { $sha.Dispose() }
|
||||||
|
$linkName = 'toolchain-' + ((($bytes[0..7]) | ForEach-Object { $_.ToString('x2') }) -join '')
|
||||||
|
|
||||||
|
$failures = @()
|
||||||
|
foreach ($base in @($env:ProgramData, $env:PUBLIC)) {
|
||||||
|
if ([string]::IsNullOrWhiteSpace($base) -or $base -match '[()&^%! ]') { continue }
|
||||||
|
$link = Join-Path (Join-Path $base 'WiiCompiled') $linkName
|
||||||
|
try {
|
||||||
|
[IO.Directory]::CreateDirectory((Split-Path -Parent $link)) | Out-Null
|
||||||
|
# The name already identifies the target, so an existing junction that still resolves is
|
||||||
|
# this one; only a broken leftover is replaced. Directory.Delete removes the reparse
|
||||||
|
# point itself, where Remove-Item -Recurse would delete the toolchain it points at.
|
||||||
|
if (-not (Test-Path -LiteralPath (Join-Path $link 'CMake\bin\cmake.exe') -PathType Leaf)) {
|
||||||
|
if (Test-Path -LiteralPath $link) { [IO.Directory]::Delete($link) }
|
||||||
|
New-Item -ItemType Junction -Path $link -Target $full -ErrorAction Stop | Out-Null
|
||||||
|
}
|
||||||
|
Write-Host "MKWCBUILD: Building through $link, because $full contains characters cmd.exe cannot parse"
|
||||||
|
return $link
|
||||||
|
} catch {
|
||||||
|
$failures += "$link ($($_.Exception.Message))"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw ("The toolchain path $full contains a character (one of ( ) & ^ % !) that the compiler " +
|
||||||
|
'cannot be invoked through, and no junction to it could be created: ' + ($failures -join '; ') +
|
||||||
|
'. Install to a path without those characters.')
|
||||||
|
}
|
||||||
|
|
||||||
function Get-MkwProjectPins([string]$ProjectFile) {
|
function Get-MkwProjectPins([string]$ProjectFile) {
|
||||||
<#
|
<#
|
||||||
The Mario Kart Wii facts pinned by projects/mkwii/recomp.yml (game identity, clean input
|
The Mario Kart Wii facts pinned by projects/mkwii/recomp.yml (game identity, clean input
|
||||||
|
|||||||
Reference in new issue
Block a user