IDE: check if compiler was changed before compiling

git-svn-id: trunk@29743 -
This commit is contained in:
mattias 2011-03-07 12:04:10 +00:00
parent 20860be566
commit 672a743b6d
3 changed files with 16 additions and 0 deletions

View File

@ -66,6 +66,7 @@ type
procedure RescanCompilerDefines(ResetBuildTarget, ClearCaches,
WaitTillDone, Quiet: boolean); virtual; abstract;
function CompilerOnDiskChanged: boolean; virtual; abstract;
function CheckAmbiguousSources(const AFilename: string;
Compiling: boolean): TModalResult; virtual; abstract;

View File

@ -165,6 +165,7 @@ type
procedure UpdateEnglishErrorMsgFilename;
procedure RescanCompilerDefines(ResetBuildTarget, ClearCaches,
WaitTillDone, Quiet: boolean); override;
function CompilerOnDiskChanged: boolean; override;
procedure LoadFPCDefinesCaches;
procedure SaveFPCDefinesCaches;
property UnitSetCache: TFPCUnitSetCache read FUnitSetCache write SetUnitSetCache;
@ -750,6 +751,17 @@ begin
end;
end;
function TBuildManager.CompilerOnDiskChanged: boolean;
var
CfgCache: TFPCTargetConfigCache;
begin
Result:=false;
if UnitSetCache=nil then exit;
CfgCache:=UnitSetCache.GetConfigCache(false);
if CfgCache=nil then exit;
Result:=CfgCache.NeedsUpdate;
end;
procedure TBuildManager.LoadFPCDefinesCaches;
var
aFilename: String;

View File

@ -12402,6 +12402,9 @@ begin
Result:=DebugBoss.DoStopProject;
if Result<>mrOk then exit;
end;
if MainBuildBoss.CompilerOnDiskChanged then
MainBuildBoss.RescanCompilerDefines(false,false,false,false);
end;
function TMainIDE.OnRunExternalTool(Tool: TIDEExternalToolOptions): TModalResult;