I have a unit for writing strings to a text file so I have a record of
how it went, and I only want to include the unit if I defined a value
at compile time. So I had
{$ifdef DEBUGLOG}
debuglog,
{$endif}
in the uses clause of the .DPR. But then Delphi wiped out the {$ifdef
DEBUGLOG} and {$endif}. So I got rid of it from there, just left it in
the uses clause of the unit which I was debugging. Sometimes Delphi
just puts it back in.
I dunno, clever IDEs may be good, but when it starts messing with the
code I put in, without asking me, I get worried that it might be _too_
clever.
FP
Unless a unit has an Initialization or Finalization section the linker is
smart enough to exclude it (or parts of it) if it is not required by the
app. If you do have such sections, try enclosing them in {$IfDef}{EndIf}.