mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 08:59:13 +02:00
IDE: simplified code
git-svn-id: trunk@41328 -
This commit is contained in:
parent
e06d6d07ee
commit
e9e769f8b2
@ -2263,78 +2263,76 @@ begin
|
|||||||
|
|
||||||
if IncludeSelf then begin
|
if IncludeSelf then begin
|
||||||
Result:=ParseOpts.MacroValues.Variables;
|
Result:=ParseOpts.MacroValues.Variables;
|
||||||
|
if ParseOpts.MacroValuesStamp=BuildMacroChangeStamp then exit;
|
||||||
|
|
||||||
if ParseOpts.MacroValuesStamp<>BuildMacroChangeStamp then begin
|
// compute macro values
|
||||||
// compute macro values
|
|
||||||
|
|
||||||
if ParseOpts.MacroValuesParsing then begin
|
if ParseOpts.MacroValuesParsing then begin
|
||||||
if ConsoleVerbosity>=-1 then
|
if ConsoleVerbosity>=-1 then
|
||||||
debugln(['TBuildManager.OnGetBuildMacroValues cycle computing macros of ',dbgsname(Options.Owner)]);
|
debugln(['TBuildManager.OnGetBuildMacroValues cycle computing macros of ',dbgsname(Options.Owner)]);
|
||||||
exit;
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
ParseOpts.MacroValuesParsing:=true;
|
||||||
|
try
|
||||||
|
Result.Clear;
|
||||||
|
|
||||||
|
// use inherited as default
|
||||||
|
Values:=OnGetBuildMacroValues(Options,false);
|
||||||
|
|
||||||
|
// add macro values of self
|
||||||
|
if Values<>nil then
|
||||||
|
Result.Assign(Values);
|
||||||
|
{$IFDEF VerboseBuildMacros}
|
||||||
|
if (Options.Owner is TLazPackage) and (TLazPackage(Options.Owner).Name='LCL') then
|
||||||
|
Result.WriteDebugReport('TPkgManager.OnGetBuildMacroValues before execute: '+dbgstr(Options.Conditionals),' ');
|
||||||
|
{$ENDIF}
|
||||||
|
if not ParseOpts.MacroValues.Execute(Options.Conditionals) then begin
|
||||||
|
if ConsoleVerbosity>=0 then
|
||||||
|
debugln(['TPkgManager.OnGetBuildMacroValues Error: ',ParseOpts.MacroValues.GetErrorStr(0)]);
|
||||||
|
debugln(Options.Conditionals);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ParseOpts.MacroValuesParsing:=true;
|
{$IFDEF VerboseBuildMacros}
|
||||||
try
|
if (Options.Owner is TLazPackage) and (TLazPackage(Options.Owner).Name='LCL') then
|
||||||
Result.Clear;
|
Result.WriteDebugReport('TPkgManager.OnGetBuildMacroValues executed: '+dbgstr(Options.Conditionals),' ');
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
// use inherited as default
|
// the macro values of the active project take precedence
|
||||||
Values:=OnGetBuildMacroValues(Options,false);
|
SetProjectMacroValues;
|
||||||
|
|
||||||
// add macro values of self
|
ParseOpts.MacroValuesStamp:=BuildMacroChangeStamp;
|
||||||
if Values<>nil then
|
finally
|
||||||
Result.Assign(Values);
|
ParseOpts.MacroValuesParsing:=false;
|
||||||
{$IFDEF VerboseBuildMacros}
|
|
||||||
if (Options.Owner is TLazPackage) and (TLazPackage(Options.Owner).Name='LCL') then
|
|
||||||
Result.WriteDebugReport('TPkgManager.OnGetBuildMacroValues before execute: '+dbgstr(Options.Conditionals),' ');
|
|
||||||
{$ENDIF}
|
|
||||||
if not ParseOpts.MacroValues.Execute(Options.Conditionals) then begin
|
|
||||||
if ConsoleVerbosity>=0 then
|
|
||||||
debugln(['TPkgManager.OnGetBuildMacroValues Error: ',ParseOpts.MacroValues.GetErrorStr(0)]);
|
|
||||||
debugln(Options.Conditionals);
|
|
||||||
end;
|
|
||||||
|
|
||||||
{$IFDEF VerboseBuildMacros}
|
|
||||||
if (Options.Owner is TLazPackage) and (TLazPackage(Options.Owner).Name='LCL') then
|
|
||||||
Result.WriteDebugReport('TPkgManager.OnGetBuildMacroValues executed: '+dbgstr(Options.Conditionals),' ');
|
|
||||||
{$ENDIF}
|
|
||||||
|
|
||||||
// the macro values of the active project take precedence
|
|
||||||
SetProjectMacroValues;
|
|
||||||
|
|
||||||
ParseOpts.MacroValuesStamp:=BuildMacroChangeStamp;
|
|
||||||
finally
|
|
||||||
ParseOpts.MacroValuesParsing:=false;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
end else begin
|
end else begin
|
||||||
Result:=ParseOpts.InheritedMacroValues;
|
Result:=ParseOpts.InheritedMacroValues;
|
||||||
|
if ParseOpts.InheritedMacroValuesStamp=BuildMacroChangeStamp then exit;
|
||||||
|
|
||||||
if ParseOpts.InheritedMacroValuesStamp<>BuildMacroChangeStamp then begin
|
// compute inherited values
|
||||||
// compute inherited values
|
if ParseOpts.InheritedMacroValuesParsing then begin
|
||||||
if ParseOpts.InheritedMacroValuesParsing then begin
|
if ConsoleVerbosity>=0 then
|
||||||
if ConsoleVerbosity>=0 then
|
debugln(['TPkgManager.OnGetBuildMacroValues circle computing inherited macros of ',dbgsname(Options.Owner)]);
|
||||||
debugln(['TPkgManager.OnGetBuildMacroValues circle computing inherited macros of ',dbgsname(Options.Owner)]);
|
exit;
|
||||||
exit;
|
end;
|
||||||
|
ParseOpts.InheritedMacroValuesParsing:=true;
|
||||||
|
try
|
||||||
|
Result.Clear;
|
||||||
|
|
||||||
|
// add inherited
|
||||||
|
if (PackageGraph<>nil) then begin
|
||||||
|
if Options.Owner is TProject then
|
||||||
|
AddAllInherited(TProject(Options.Owner).FirstRequiredDependency,Result)
|
||||||
|
else if Options.Owner is TLazPackage then
|
||||||
|
AddAllInherited(TLazPackage(Options.Owner).FirstRequiredDependency,Result);
|
||||||
end;
|
end;
|
||||||
ParseOpts.InheritedMacroValuesParsing:=true;
|
|
||||||
try
|
|
||||||
Result.Clear;
|
|
||||||
|
|
||||||
// add inherited
|
// the macro values of the active project take precedence
|
||||||
if (PackageGraph<>nil) then begin
|
SetProjectMacroValues;
|
||||||
if Options.Owner is TProject then
|
|
||||||
AddAllInherited(TProject(Options.Owner).FirstRequiredDependency,Result)
|
|
||||||
else if Options.Owner is TLazPackage then
|
|
||||||
AddAllInherited(TLazPackage(Options.Owner).FirstRequiredDependency,Result);
|
|
||||||
end;
|
|
||||||
|
|
||||||
// the macro values of the active project take precedence
|
ParseOpts.InheritedMacroValuesStamp:=BuildMacroChangeStamp;
|
||||||
SetProjectMacroValues;
|
finally
|
||||||
|
ParseOpts.InheritedMacroValuesParsing:=false;
|
||||||
ParseOpts.InheritedMacroValuesStamp:=BuildMacroChangeStamp;
|
|
||||||
finally
|
|
||||||
ParseOpts.InheritedMacroValuesParsing:=false;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user