[Lazarus] Conditional compilation depending on Lazarus version?

cobines cobines at gmail.com
Thu Mar 22 19:17:51 CET 2012


2012/3/22 Mark Morgan Lloyd <markMLl.lazarus at telemetry.co.uk>:
> At that point if there's an ./ide/revision.inc file containing
>
> // Created by Svn2RevisionInc
> const RevisionStr = '35880M';
>
> can it be included into a unit to make it visible at compile time?

You can add "$(LazarusDir)\ide" to the include paths of the project.
Then this works:

{$I revision.inc}

const
  revIntroducedNewFeature = '55555';

begin
  {$IF (RevisionStr >= revIntroducedNewFeature)}
  UseNewFeature;
  {$ENDIF}
end;

--
cobines




More information about the Lazarus mailing list