瀏覽代碼

Add compile-bcc32c.bat to compile Lzma2Decode using Embarcadero's free C++ compiler (https://www.embarcadero.com/free-tools/ccompiler) instead. This offers source level debugging support. Didn't know about this compiler before. Still kept the .obj's from Visual Studio.

Martijn Laan 1 年之前
父節點
當前提交
25b27fd8b6
共有 2 個文件被更改,包括 45 次插入0 次删除
  1. 2 0
      Projects/Src/Setup/LZMADecomp.pas
  2. 43 0
      Projects/Src/Setup/Lzma2Decode/compile-bcc32c.bat

+ 2 - 0
Projects/Src/Setup/LZMADecomp.pas

@@ -93,6 +93,8 @@ const
     size the compiler currently allows. }
   MaxDictionarySize = 1024 shl 20;  { 1 GB }
 
+{ Compiled by Visual Studio 2022 using compile.bat
+  To enable source debugging recompile using compile-bcc32c.bat }
 {$L Src\Setup\Lzma2Decode\ISLzmaDec.obj}
 {$L Src\Setup\Lzma2Decode\ISLzma2Dec.obj}
 

+ 43 - 0
Projects/Src/Setup/Lzma2Decode/compile-bcc32c.bat

@@ -0,0 +1,43 @@
+@echo off
+
+rem  Inno Setup
+rem  Copyright (C) 1997-2024 Jordan Russell
+rem  Portions by Martijn Laan
+rem  For conditions of distribution and use, see LICENSE.TXT.
+rem
+rem  Batch file to compile LzmaDecodeInno.c using Embarcadero's free
+rem  C++ compiler from https://www.embarcadero.com/free-tools/ccompiler
+rem  with source debugging turned on
+
+setlocal
+
+cd /d %~dp0
+
+if exist compilesettings.bat goto compilesettingsfound
+:compilesettingserror
+echo compilesettings.bat is missing or incomplete. It needs to be created
+echo with the following line, adjusted for your system:
+echo.
+echo   set BCCROOT=C:\BCC102
+goto failed2
+
+:compilesettingsfound
+set BCCROOT=
+call .\compilesettings.bat
+if "%BCCROOT%"=="" goto compilesettingserror
+
+rem -------------------------------------------------------------------------
+
+echo - Compiling ISLzmaDec.c and ISLzma2Dec.c
+"%BCCROOT%\bin\bcc32c.exe" -c -O2 -v ISLzmaDec.c ISLzma2Dec.c
+if errorlevel 1 goto failed
+
+echo Success!
+goto exit
+
+:failed
+echo *** FAILED ***
+:failed2
+exit /b 1
+
+:exit