mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 22:19:18 +02:00
ambigious unit check now ignores virtual units
git-svn-id: trunk@4924 -
This commit is contained in:
parent
c0c8c62221
commit
457e1dd6d3
@ -1347,6 +1347,8 @@ function TLazPackageGraph.FindAmbigiousUnits(APackage: TLazPackage;
|
|||||||
// returns true, if ambigious units found
|
// returns true, if ambigious units found
|
||||||
// There can either be a conflict between two files (File1,File2)
|
// There can either be a conflict between two files (File1,File2)
|
||||||
// or between a file and a package (File1,ConflictPkg)
|
// or between a file and a package (File1,ConflictPkg)
|
||||||
|
const
|
||||||
|
FileTypes = PkgFileUnitTypes-[pftVirtualUnit];
|
||||||
var
|
var
|
||||||
PackageTreeOfUnitTrees: TAVLTree; // tree of TPkgUnitsTree
|
PackageTreeOfUnitTrees: TAVLTree; // tree of TPkgUnitsTree
|
||||||
|
|
||||||
@ -1370,7 +1372,7 @@ var
|
|||||||
PackageTreeOfUnitTrees.Add(Result);
|
PackageTreeOfUnitTrees.Add(Result);
|
||||||
for i:=0 to Pkg.FileCount-1 do begin
|
for i:=0 to Pkg.FileCount-1 do begin
|
||||||
PkgFile:=Pkg.Files[i];
|
PkgFile:=Pkg.Files[i];
|
||||||
if (PkgFile.FileType in PkgFileUnitTypes) and (PkgFile.UnitName<>'') then
|
if (PkgFile.FileType in FileTypes) and (PkgFile.UnitName<>'') then
|
||||||
Result.Add(PkgFile);
|
Result.Add(PkgFile);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -1396,7 +1398,7 @@ var
|
|||||||
end;
|
end;
|
||||||
for i:=0 to Pkg1.FileCount-1 do begin
|
for i:=0 to Pkg1.FileCount-1 do begin
|
||||||
PkgFile1:=Pkg1.Files[i];
|
PkgFile1:=Pkg1.Files[i];
|
||||||
if (PkgFile1.FileType in PkgFileUnitTypes)
|
if (PkgFile1.FileType in FileTypes)
|
||||||
and (PkgFile1.UnitName<>'') then begin
|
and (PkgFile1.UnitName<>'') then begin
|
||||||
// check if a unit of Pkg1 exists in Pkg2
|
// check if a unit of Pkg1 exists in Pkg2
|
||||||
PkgFile2:=UnitsTreeOfPkg2.FindPkgFileWithUnitName(PkgFile1.UnitName);
|
PkgFile2:=UnitsTreeOfPkg2.FindPkgFileWithUnitName(PkgFile1.UnitName);
|
||||||
@ -1474,6 +1476,7 @@ function TLazPackageGraph.FindFPCConflictUnit(APackage: TLazPackage;
|
|||||||
var
|
var
|
||||||
Cnt: Integer;
|
Cnt: Integer;
|
||||||
i: Integer;
|
i: Integer;
|
||||||
|
CurFile: TPkgFile;
|
||||||
begin
|
begin
|
||||||
Result:=false;
|
Result:=false;
|
||||||
if (Pkg1=nil) or (lpfVisited in Pkg1.Flags)
|
if (Pkg1=nil) or (lpfVisited in Pkg1.Flags)
|
||||||
@ -1486,10 +1489,13 @@ function TLazPackageGraph.FindFPCConflictUnit(APackage: TLazPackage;
|
|||||||
end;
|
end;
|
||||||
Cnt:=Pkg1.FileCount;
|
Cnt:=Pkg1.FileCount;
|
||||||
for i:=0 to Cnt-1 do begin
|
for i:=0 to Cnt-1 do begin
|
||||||
Result:=CheckUnitName(Pkg1.Files[i].UnitName);
|
CurFile:=Pkg1.Files[i];
|
||||||
if Result then begin
|
if CurFile.FileType in (PkgFileUnitTypes-[pftVirtualUnit]) then begin
|
||||||
File1:=Pkg1.Files[i];
|
Result:=CheckUnitName(CurFile.UnitName);
|
||||||
exit;
|
if Result then begin
|
||||||
|
File1:=CurFile;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
Result:=CheckDependencyList(Pkg1.FirstRequiredDependency);
|
Result:=CheckDependencyList(Pkg1.FirstRequiredDependency);
|
||||||
|
Loading…
Reference in New Issue
Block a user