compile.bat 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. @echo off
  2. rem Inno Setup
  3. rem Copyright (C) 1997-2025 Jordan Russell
  4. rem Portions by Martijn Laan
  5. rem For conditions of distribution and use, see LICENSE.TXT.
  6. rem
  7. rem Batch file to compile IS7zDec.c
  8. setlocal
  9. cd /d %~dp0
  10. if "%1"=="x86" goto archfound
  11. if "%1"=="x64" goto archfound
  12. if "%1"=="arm64" goto archfound
  13. echo Architecture parameter is missing or invalid. Must be "x86" or "x64" or "arm64".
  14. goto failed2
  15. :archfound
  16. if exist compilesettings.bat goto compilesettingsfound
  17. :compilesettingserror
  18. echo compilesettings.bat is missing or incomplete. It needs to be created
  19. echo with the following line, adjusted for your system:
  20. echo.
  21. echo set VSTOOLSROOT=C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools
  22. goto failed2
  23. :compilesettingsfound
  24. set VSTOOLSROOT=
  25. call .\compilesettings.bat
  26. if "%VSTOOLSROOT%"=="" goto compilesettingserror
  27. rem -------------------------------------------------------------------------
  28. set __VSCMD_ARG_NO_LOGO=1
  29. set VSCMD_SKIP_SENDTELEMETRY=1
  30. echo - Calling VsDevCmd.bat -arch=%1 -host_arch=x64
  31. call "%VSTOOLSROOT%\VsDevCmd.bat" -arch=%1 -host_arch=x64
  32. if errorlevel 1 goto exit
  33. echo.
  34. echo - Compiling IS7zDec.c
  35. cl.exe /c /O2 /GS- IS7zDec.c /FoIS7zDec-%1.obj
  36. if errorlevel 1 goto failed
  37. echo Success!
  38. goto exit
  39. :failed
  40. echo *** FAILED ***
  41. :failed2
  42. exit /b 1
  43. :exit