Are Delphi 2007 (or 2009) events related to building configurations?

Can I add assembly events only for a specific build configuration in Delphi 2007?

I use 2007, but you will be interested in what you can do in 2009 as well.

Cheers Sam

+4
source share
3 answers

No.

You may have (resources) compiler options for each build configuration in Delphi 2009. But this does not apply to other settings.

You can fake it, but it takes some time:

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

code:

uses .. {$IFDEF DEBUG} confDebug, {$ELSE} confRelease, {$ENDIF} .. 
  • Now let post post build check for confDebug.dcu or confRelease.dcu to find which build configuration is being used.

It's a little cumbersome, but you can do what you want.

+3
source

Yes!

As you can have separate defines in each assembly configuration. You can check what your project defines to handle conditional assembly.

I am using something like this:

 echo $(DEFINES) | find "RELEASE"> nul if not errorlevel 1 goto release echo $(DEFINES) | find "DEBUG" > nul if not errorlevel 1 goto debug goto end :release echo Processing RELEASE Build: ... goto end :debug echo Processing DEBUG Build: .. goto end :end 
+4
source

Try the following:

 if $(Config) == Release do_something 

Here you can find more information.

+1
source

All Articles