codetools: find sources in fpc unit search paths

git-svn-id: trunk@32240 -
This commit is contained in:
mattias 2011-09-09 19:00:32 +00:00
parent d7f55a0794
commit 73d34d3088
3 changed files with 15 additions and 4 deletions

View File

@ -5630,7 +5630,7 @@ begin
debugln(['TCodeToolManager.DirectoryCachePoolGetUnitFromSet outdated UnitSet="',dbgstr(UnitSet),'"']);
exit;
end;
Result:=UnitSetCache.GetUnitSrcFile(AnUnitName);
Result:=UnitSetCache.GetUnitSrcFile(AnUnitName,false);
end;
function TCodeToolManager.DirectoryCachePoolGetCompiledUnitFromSet(

View File

@ -8810,7 +8810,7 @@ begin
if ConfigCache.HasPPUs then begin
// but there are other ppu files
{$IFDEF ShowTriedUnits}
debugln(['TFPCUnitSetCache.GetUnitSrcFile Unit="',AnUnitName,'" unit has no ppu file in FPC path, but there are other']);
debugln(['TFPCUnitSetCache.GetUnitSrcFile Unit="',AnUnitName,'" unit has no ppu file in FPC path, but there are other ppu']);
{$ENDIF}
exit;
end else begin
@ -8828,8 +8828,19 @@ begin
end;
if Tree<>nil then begin
Result:=Tree[AnUnitName];
if Result<>'' then
if (Result<>'') and (not FilenameIsAbsolute(Result)) then
Result:=FPCSourceDirectory+Result;
if (Result='') then begin
// maybe the source is in the fpc search path
ConfigCache:=GetConfigCache(false);
if ConfigCache<>nil then begin
Result:=ConfigCache.Units[AnUnitName];
if (CompareFileExt(Result,'ppu',false)=0) then begin
Result:='';
exit;
end;
end;
end;
{$IFDEF ShowTriedUnits}
debugln(['TFPCUnitSetCache.GetUnitSrcFile Unit="',AnUnitName,'" Result=',Result]);
{$ENDIF}

View File

@ -1223,7 +1223,7 @@ begin
Result:=FindUnitSourceInCleanSearchPath(AUnitName,SrcPath,AnyCase);
end;
if Result='' then begin
// search in unit links
// search in unit set
{$IFDEF ShowTriedUnits}
DebugLn(['TCTDirectoryCache.FindUnitSourceInCompletePath unit ',AUnitName,' not found in SrcPath="',SrcPath,'" Directory="',Directory,'" searchin in unitset ...']);
{$ENDIF}