优化减少Delphi XE系列 IDE 编译程序体积

来源:互联网 发布:中文语音数据库 编辑:程序博客网 时间:2024/06/03 14:24
1
2
3
4
5
{ Reduce EXE size by disabling as much of RTTI as possible (delphi XE10.1 }
{$IF CompilerVersion >= 21.0}
{$WEAKLINKRTTI ON}
{$RTTI EXPLICIT METHODS([]) PROPERTIES([]) FIELDS([])}
{$ENDIF}

示例:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
program Project1;
{ Reduce EXE size by disabling as much of RTTI as possible (delphi XE10.1 }
{$IF CompilerVersion >= 21.0}
{$WEAKLINKRTTI ON}
{$RTTI EXPLICIT METHODS([]) PROPERTIES([]) FIELDS([])}
{$ENDIF}
uses
  Vcl.Forms,
  Unit1 in 'Unit1.pas' {Form1};
{$R *.res}
begin
  Application.Initialize;
  Application.MainFormOnTaskbar := True;
  Application.CreateForm(TForm1, Form1);
  Application.Run;
end.

二、关闭DEBUG信息

1
Project->options->Linking->debug information 设置为False即可

阅读全文
0 0