@echo off

@REM Note : This batch file must be used with Visual Studio 2017+ MSBuild

@REM This is batch file to build GFN PFW for ARM64 (WOA).
@REM ARM64/Release build will be built.

echo.
echo ===============================================================================
echo ========================= Building GFN PFW ARM64 ==============================
echo ===============================================================================

echo Building 7zSfxMod for ARM64
call build7zSfx_arm64.bat
if errorlevel 1 (
    echo ERROR: Failed to build 7zSfxMod ARM64
    exit /b 1
)

echo.
echo ===============================================================================
echo ========================= Building PFW Solution ARM64 ===========================
echo ===============================================================================

echo Building pfw.exe for ARM64

@REM Build the .NET solution for ARM64 deployment
@REM Note: .NET Framework 3.5 csc.exe does not support /platform:ARM64. AnyCPU assemblies run on ARM64
@REM via the .NET runtime's JIT - they are compiled to ARM64 native code at load time on ARM64 Windows.
call C:\Windows\Microsoft.NET\Framework64\v3.5\MSBuild.exe "pfw\pfw.sln" /t:Rebuild /p:Configuration=Release /p:Platform="Any CPU"

if errorlevel 1 (
    echo ERROR: Failed to build PFW solution for ARM64
    exit /b 1
)

echo.
echo ===============================================================================
echo ========================= ARM64 Build Completed =================================
echo ===============================================================================
echo.
echo Build artifacts:
echo   - 7zSfxMod binaries: SFX\Output\arm64\
echo   - PFW executable: pfw\PfwConsoleApplication\bin\Release\
echo   - SFX files: pfw\BinRef\Prerequisites\resources\arm64\
echo.
