Delphi 2007 (or 2009) build events tied to build configurations

delphidelphi-2007

Is it possible to add build events only for a specific build configuration in Delphi 2007 ?

I use 2007 but would be interested in what you can do in 2009 also.

Cheers
Sam

Best Answer

No.

You can have (resource) compiler settings for each build configuration in Delphi 2009. But this does not apply to the other settings.

You can fake it, but it takes some time:

  1. In the prebuild, delete the conf*.dcu files.
  2. Define DEBUG for the debug configuration.
  3. Add the following to the project file:

Code:

uses
  ..
{$IFDEF DEBUG}
  confDebug,
{$ELSE}
  confRelease,
{$ENDIF}
  ..
  1. Now let the post build step check for the existence of confDebug.dcu or confRelease.dcu to find which build configuration is used.

It is a bit cumbersome, but you can do what you want.

Related Topic