1.2.25 $SMARTLINK : Use smartlinking

A unit that is compiled in the f$SMARTLINK ONg state will be compiled in such a way that it can be used for smartlinking. This means that the unit is chopped in logical pieces: each procedure is put in it's own object le, and all object les are put together in a big archive. When using such a unit, only the pieces of code that you really need or call, will be linked in your program, thus reducing the size of your executable substantially.

Beware: using smartlinked units slows down the compilation process, because a separate object le must be created for each procedure. If you have units with many functions and procedures, this can be a time consuming process, even more so if you use an external assembler (the assembler is called to assemble each procedure or function code block separately).

The smartlinking directive should be specied before the unit declaration part:

{$SMARTLINK ON}  
 
Unit MyUnit;  
 
Interface  
 ...

This directive is equivalent to the -Cx command-line switch.