Monorepo for Aesthetic.Computer aesthetic.computer
at main 93 lines 3.4 kB view raw
1# Comprehensive fix for FMOD build issues 2# Run as Administrator 3 4#Requires -RunAsAdministrator 5 6Write-Host "=========================================" -ForegroundColor Cyan 7Write-Host "Fixing FMOD Build Issues" -ForegroundColor Cyan 8Write-Host "=========================================" -ForegroundColor Cyan 9Write-Host "" 10 11$ProjectRoot = "C:\Perforce\SpiderLily\SL_main" 12$FMODPlugin = "$ProjectRoot\Plugins\FMODStudio" 13 14# 1. Fix all corrupted generated files 15Write-Host "Step 1: Fixing corrupted generated includes..." -ForegroundColor Yellow 16 17$corruptedFiles = @( 18 "$FMODPlugin\Intermediate\Build\Win64\UnrealGame\Inc\FMODStudio\UHT\FMODCallbackHandler.gen.cpp", 19 "$FMODPlugin\Intermediate\Build\Win64\UnrealEditor\Inc\FMODStudio\UHT\FMODCallbackHandler.gen.cpp" 20) 21 22foreach ($file in $corruptedFiles) { 23 if (Test-Path $file) { 24 $content = Get-Content -Path $file -Raw 25 if ($content -match 'allbackHandler\.h') { 26 $fixed = $content -replace '"allbackHandler\.h"', '"FMODCallbackHandler.h"' 27 Set-Content -Path $file -Value $fixed -NoNewline 28 Write-Host "[OK] Fixed: $file" -ForegroundColor Green 29 } 30 } 31} 32 33Write-Host "" 34 35# 2. Check for missing FMOD libraries 36Write-Host "Step 2: Checking FMOD libraries..." -ForegroundColor Yellow 37 38$fmodLibs = @( 39 "$FMODPlugin\Binaries\Win64\fmodL_vc.lib", 40 "$FMODPlugin\Binaries\Win64\fmodstudioL_vc.lib", 41 "$FMODPlugin\Binaries\Win64\fmodL.dll", 42 "$FMODPlugin\Binaries\Win64\fmodstudioL.dll" 43) 44 45$missingLibs = @() 46foreach ($lib in $fmodLibs) { 47 if (!(Test-Path $lib)) { 48 Write-Host "[MISSING] $lib" -ForegroundColor Red 49 $missingLibs += $lib 50 } else { 51 Write-Host "[OK] Found: $(Split-Path $lib -Leaf)" -ForegroundColor Green 52 } 53} 54 55Write-Host "" 56 57if ($missingLibs.Count -gt 0) { 58 Write-Host "[ERROR] Missing FMOD library files!" -ForegroundColor Red 59 Write-Host "" 60 Write-Host "These files should be in Perforce. Force sync:" -ForegroundColor Yellow 61 Write-Host " cd C:\Perforce" -ForegroundColor Gray 62 Write-Host " p4 sync -f //SpiderLily/Plugins/FMODStudio/Binaries/Win64/..." -ForegroundColor Gray 63 Write-Host "" 64 Write-Host "Or check if you have the correct Perforce workspace view." -ForegroundColor Yellow 65} else { 66 Write-Host "[OK] All FMOD libraries present" -ForegroundColor Green 67} 68 69Write-Host "" 70Write-Host "Step 3: Preventing regeneration..." -ForegroundColor Yellow 71 72# Mark the fixed files as read-only to prevent UHT from regenerating them 73foreach ($file in $corruptedFiles) { 74 if (Test-Path $file) { 75 Set-ItemProperty -Path $file -Name IsReadOnly -Value $true 76 Write-Host "[OK] Marked read-only: $(Split-Path $file -Leaf)" -ForegroundColor Green 77 } 78} 79 80Write-Host "" 81Write-Host "=========================================" -ForegroundColor Cyan 82Write-Host "Fix Complete" -ForegroundColor Cyan 83Write-Host "=========================================" -ForegroundColor Cyan 84Write-Host "" 85 86if ($missingLibs.Count -eq 0) { 87 Write-Host "Next: Retry the build" -ForegroundColor Green 88 Write-Host " powershell.exe -ExecutionPolicy Bypass -File ""\\wsl.localhost\Ubuntu\home\me\aesthetic-computer\windows\build-false-work.ps1""" -ForegroundColor Gray 89} else { 90 Write-Host "Next: Sync missing FMOD files from Perforce first" -ForegroundColor Yellow 91} 92 93Write-Host ""