mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-22 15:19:29 +02:00
IDE: Added optional parameters for the LazVer macro similar to ProjVer
This commit is contained in:
parent
a4e6f6d2e4
commit
0ae105c41b
@ -35,7 +35,7 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
// RTL + FCL
|
// RTL + FCL
|
||||||
Classes, SysUtils, Types, AVL_Tree, System.UITypes,
|
Classes, SysUtils, Types, AVL_Tree, System.UITypes, StrUtils,
|
||||||
// LCL
|
// LCL
|
||||||
InterfaceBase, LCLPlatformDef,
|
InterfaceBase, LCLPlatformDef,
|
||||||
// CodeTools
|
// CodeTools
|
||||||
@ -2273,7 +2273,15 @@ end;
|
|||||||
function TBuildManager.MacroFuncLazVer(const Param: string; const Data: PtrInt;
|
function TBuildManager.MacroFuncLazVer(const Param: string; const Data: PtrInt;
|
||||||
var Abort: boolean): string;
|
var Abort: boolean): string;
|
||||||
begin
|
begin
|
||||||
Result:=LazarusVersionStr;
|
if Param = '' then exit(LazarusVersionStr)
|
||||||
|
else if CompareText(Param, 'major') = 0 then result := ExtractDelimited(1, LazarusVersionStr, ['.'])
|
||||||
|
else if CompareText(Param, 'minor') = 0 then result := ExtractDelimited(2, LazarusVersionStr, ['.'])
|
||||||
|
else if CompareText(Param, 'rev' ) = 0 then result := ExtractDelimited(3, LazarusVersionStr, ['.'])
|
||||||
|
else if CompareText(Param, 'build') = 0 then result := ExtractDelimited(4, LazarusVersionStr, ['.'])
|
||||||
|
else exit(''); // invalid parameter
|
||||||
|
|
||||||
|
if result = '' then
|
||||||
|
result := '0';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TBuildManager.MacroFuncTargetCPU(const Param: string;
|
function TBuildManager.MacroFuncTargetCPU(const Param: string;
|
||||||
|
Loading…
Reference in New Issue
Block a user