IDE: when checking if a FPC unit has changed: ignore units that have no source in the FPC sources

git-svn-id: trunk@36800 -
This commit is contained in:
mattias 2012-04-15 19:03:27 +00:00
parent 0a8f6cd6b1
commit 9c9e3dbefe

View File

@ -2766,6 +2766,8 @@ var
Node: TAVLTreeNode;
Item: PStringToStringTreeItem;
Filename: String;
UnitToSrcTree: TStringToStringTree;
CurUnitName: String;
begin
Result:=false;
if TheOwner=nil then exit;
@ -2789,9 +2791,17 @@ begin
CfgCache:=Cache.GetConfigCache(false);
if CfgCache=nil then exit;
if CfgCache.Units=nil then exit;
UnitToSrcTree:=Cache.GetUnitToSourceTree(false);
Node:=CfgCache.Units.Tree.FindLowest;
while Node<>nil do begin
Item:=PStringToStringTreeItem(Node.Data);
Node:=CfgCache.Units.Tree.FindSuccessor(Node);
CurUnitName:=Item^.Name;
if not UnitToSrcTree.Contains(CurUnitName) then begin
// this unit has no source in the FPC source directory
// probably an user unit reachable through a unit path in fpc.cfg
continue;
end;
Filename:=Item^.Value;
if FileAgeCached(Filename)>StateFileAge then begin
debugln(['TLazPackageGraph.CheckCompileNeedDueToFPCUnits FPC unit "',Filename,'" is newer than state file of ',ID]);
@ -2800,7 +2810,6 @@ begin
+' state file age='+FileAgeToStr(StateFileAge)+LineEnding;
exit(true);
end;
Node:=CfgCache.Units.Tree.FindSuccessor(Node);
end;
end;