IDE: check if project needs compile: check lfm too, bug #21206

git-svn-id: trunk@35910 -
This commit is contained in:
mattias 2012-03-12 22:25:31 +00:00
parent 2a417ff43a
commit 7763dcfc36

View File

@ -11567,6 +11567,7 @@ var
StateFilename: String;
StateFileAge: LongInt;
AnUnitInfo: TUnitInfo;
LFMFilename: String;
begin
NeedBuildAllFlag:=false;
if (AProject.LastCompilerFilename<>CompilerFilename)
@ -11633,10 +11634,19 @@ begin
// check project files
AnUnitInfo:=AProject.FirstPartOfProject;
while AnUnitInfo<>nil do begin
if FileExistsCached(AnUnitInfo.Filename)
and (StateFileAge<FileAgeCached(AnUnitInfo.Filename)) then begin
DebugLn('TMainIDE.CheckIfProjectNeedsCompilation Src has changed ',AProject.IDAsString,' ',AnUnitInfo.Filename);
exit(mrYes);
if FileExistsCached(AnUnitInfo.Filename) then begin
if (StateFileAge<FileAgeCached(AnUnitInfo.Filename)) then begin
DebugLn('TMainIDE.CheckIfProjectNeedsCompilation Src has changed ',AProject.IDAsString,' ',AnUnitInfo.Filename);
exit(mrYes);
end;
if AnUnitInfo.ComponentName<>'' then begin
LFMFilename:=ChangeFileExt(AnUnitInfo.Filename,'.lfm');
if FileExistsCached(LFMFilename)
and (StateFileAge<FileAgeCached(LFMFilename)) then begin
DebugLn('TMainIDE.CheckIfProjectNeedsCompilation LFM has changed ',AProject.IDAsString,' ',LFMFilename);
exit(mrYes);
end;
end;
end;
AnUnitInfo:=AnUnitInfo.NextPartOfProject;
end;