#1 2024-10-16 07:17:17

Mobius1
Member
Registered: 2023-08-16
Posts: 9

How can I check framework version within a compiler directive

Hi, I need to reliably check SYNOPSE_FRAMEWORK_VERSION between 2.2 stable and 2.2 main to adjust a code, I tried doing:
{$IF StrToIntDef(Copy(SYNOPSE_FRAMEWORK_VERSION, Length(SYNOPSE_FRAMEWORK_VERSION) - 4, 4), 0) >= 8236}
but it didn't work... I'm on lazarus 3.7/FPC 3.2.3 atm but the code should be compatible with Delphi as well.

Does anyone have an idea on how I should do this check? Thanks in advance

Offline

#2 2024-10-16 07:53:36

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: How can I check framework version within a compiler directive

You can't execute code within compiler directives, by design.

I have added some MORMOT* conditionals from now on:
https://github.com/synopse/mORMot2/commit/dd6ab8ab
But nothing retroactive.

Note that I will release mORMot 2.3 today.
Do you have any last minute complain/notification/warning about the current state of the code, which may prevent a release?

Offline

#3 2024-10-16 08:32:39

Mobius1
Member
Registered: 2023-08-16
Posts: 9

Re: How can I check framework version within a compiler directive

Thanks ab, those directives will solve the issue and since it'll be a new release I'll aim the compatibility into it

Also the .lpk should replicate the version info, its still 2.0.1

Last edited by Mobius1 (2024-10-16 08:33:45)

Offline

#4 2024-10-16 20:27:42

Mobius1
Member
Registered: 2023-08-16
Posts: 9

Re: How can I check framework version within a compiler directive

Lazarus package is still on 2.0.1 on stable 2.3:
https://prnt.sc/jqwVHOOTEixj

You should consider updating this number, so any other packages who depends on mORMot2 can make a better version-aware depedancy with it, for example:
https://prnt.sc/QRDDnOncArm4

Offline

Board footer

Powered by FluxBB