views:

517

answers:

3
+1  A: 

Well this work-around worked for me.

//{$define PACKAGE}
{$ifdef PACKAGE}
 uses 
  unit1 in 'unit1.pas'
  unit2 in 'unit2.pas'
   ... 
{$else}
 uses 
  unit1 
  unit2
   ...
{$endif}

The only problem is whenever you add a new unit, delphi erases your ifdef package at the top.

Peter Turner
I dunno dude, this solution may prove too cumbersome for your co-workers to absorb.
Peter Turner
Are you really talking to yourself ?
Romain Verdier
A: 

Every time I have to put conditionals into a project file I do this:

program a;

uses
  ACondUnits;

...


unit ACondUnits;

interface

uses
{$IFDEF UseD7MM}
  Delphi7MM;
{$ELSE}
  FastMM4;
{$ENDIF}

implementation

end.

Maybe this trick works in packages too. Never tried.

gabr
+2  A: 

It could come from the fact, that the search path in the IDE and the search path of the command line compiler are not the same. If you change the serach path of the command line compiler you might be able to use the exactely same source code as within the IDE.

One possibility to configure the search path for the command-line compiler is to do it in a file called dcc32.cfg. Take a look at the help, there is a short description of dcc32.cfg in the IDE-help.