From badac6ae4a66462d17bf1de9f78e2022f5955fe5 Mon Sep 17 00:00:00 2001 From: mattias Date: Thu, 15 Mar 2012 13:23:00 +0000 Subject: [PATCH] IDE: macro TargetOS(IDE) return os of IDE executable, analog macro TargetCPU, macro SrcOS(os) git-svn-id: trunk@36031 - --- ide/buildmanager.pas | 6 ++++++ ide/initialsetupdlgs.pas | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ide/buildmanager.pas b/ide/buildmanager.pas index 6904fb22a7..c1206824b0 100644 --- a/ide/buildmanager.pas +++ b/ide/buildmanager.pas @@ -1471,6 +1471,8 @@ function TBuildManager.MacroFuncTargetCPU(const Param: string; begin if Data=CompilerOptionMacroPlatformIndependent then Result:='%(CPU_TARGET)' + else if SysUtils.CompareText(Param,'IDE')=0 then + Result:=GetCompiledTargetCPU else Result:=GetTargetCPU; end; @@ -1480,6 +1482,8 @@ function TBuildManager.MacroFuncTargetOS(const Param: string; begin if Data=CompilerOptionMacroPlatformIndependent then Result:='%(OS_TARGET)' + else if SysUtils.CompareText(Param,'IDE')=0 then + Result:=GetCompiledTargetOS else Result:=GetTargetOS; end; @@ -1520,6 +1524,8 @@ function TBuildManager.MacroFuncSrcOS(const Param: string; const Data: PtrInt; begin if Data=CompilerOptionMacroPlatformIndependent then Result:='%(OS_TARGET)' + else if Param<>'' then + Result:=GetDefaultSrcOSForTargetOS(Param) else Result:=GetDefaultSrcOSForTargetOS(GetTargetOS); end; diff --git a/ide/initialsetupdlgs.pas b/ide/initialsetupdlgs.pas index 4cb73011c6..be244e6193 100644 --- a/ide/initialsetupdlgs.pas +++ b/ide/initialsetupdlgs.pas @@ -846,11 +846,11 @@ begin s:=LazarusDir else s:=''; - end else if CompareText(MacroName,'TargetOS')=0 then + end else if (CompareText(MacroName,'TargetOS')=0) then s:=GetCompiledTargetOS - else if CompareText(MacroName,'TargetCPU')=0 then + else if (CompareText(MacroName,'TargetCPU')=0) then s:=GetCompiledTargetCPU - else if CompareText(MacroName,'SrcOS')=0 then + else if (CompareText(MacroName,'SrcOS')=0) then s:=GetDefaultSrcOSForTargetOS(GetCompiledTargetOS) else Handled:=false;