How can I set the $RTTI directive for the entire project?

前端 未结 5 2170
暗喜
暗喜 2021-01-03 08:48

I\'m working on migrating an old project from Delphi 2007 to Delphi 2010. One thing I\'ve found is that the resulting executable has more than doubled in size, and the orig

5条回答
  •  梦毁少年i
    2021-01-03 09:46

    You can try with the dcc32 –$weaklinkrtti command-line option. (like {$WEAKLINKRTTI ON}).
    But that has not the impact of {$RTTI EXPLICIT METHODS([]) PROPERTIES([]) FIELDS([])} in each unit.
    Your best bet would be to have it at the top of each unit in an include file.
    But then it wouldn't do it for the VCL/RTL which would still be inflated....

    Update: Also make sure you compare what's comparable. For instance verify if you don't include debug information in the Linker Options in the new D2010 project where you may not have it in the D2007 one...

提交回复
热议问题