[Lazarus] Conditional compilation depending on Lazarus version?

Reinier Olislagers reinierolislagers at gmail.com
Thu Mar 22 11:32:53 CET 2012


Hi list,

I'm sure I must be missing something.

I want to compile some grid drawing stuff depending on whether a grid
bug has been fixed - i.e. I want to do something like this:

Had a look here:
http://wiki.lazarus.freepascal.org/IDE_Macros_in_paths_and_filenames
... but that only seems to specify support for FPC version, not Lazarus
version.

Ideally, I'd be looking at something like:
  {$IF LAZARUSREVISION>=36180}
  // Note: normally, grid DefaultDrawing property must be off to avoid
duplicate drawing
  // This will result in duplicate drawing but should work.
  DefaultDrawing:=true;
  {$ENDIF}

Is something like this possible, or is there an easier way of doing things?

I realize that the code above will be compiled by FPC, not Lazarus;
perhaps it is possible to set an environment variable LAZARUSREVISION
and/or LAZARUSVERSION and get these into FPC macros in some way?


Thanks,
Reinier




More information about the Lazarus mailing list