mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-08 09:20:49 +02:00
IDE: check compiler: added test to search for FPC ppus in project/package unit search path
git-svn-id: trunk@11694 -
This commit is contained in:
parent
2d3019ded3
commit
82a4a6b5e8
@ -81,7 +81,8 @@ type
|
|||||||
function CheckMissingFPCPPUs(PPUs: TStrings): TModalResult;
|
function CheckMissingFPCPPUs(PPUs: TStrings): TModalResult;
|
||||||
function CheckCompilerDate(const CompilerFilename: string;
|
function CheckCompilerDate(const CompilerFilename: string;
|
||||||
PPUs: TStrings): TModalResult;
|
PPUs: TStrings): TModalResult;
|
||||||
function CheckForAmbiguousPPUs(PPUs: TStrings): TModalResult;
|
function CheckForAmbiguousPPUs(SearchForPPUs: TStrings;
|
||||||
|
SearchInPPUs: TStrings = nil): TModalResult;
|
||||||
function CheckFPCUnitPathsContainSources(const FPCCfgUnitPath: string
|
function CheckFPCUnitPathsContainSources(const FPCCfgUnitPath: string
|
||||||
): TModalResult;
|
): TModalResult;
|
||||||
function CheckCompileBogusFile(const CompilerFilename: string): TModalResult;
|
function CheckCompileBogusFile(const CompilerFilename: string): TModalResult;
|
||||||
@ -612,25 +613,36 @@ begin
|
|||||||
Result:=mrOk;
|
Result:=mrOk;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCheckCompilerOptsDlg.CheckForAmbiguousPPUs(PPUs: TStrings
|
function TCheckCompilerOptsDlg.CheckForAmbiguousPPUs(SearchForPPUs: TStrings;
|
||||||
): TModalResult;
|
SearchInPPUs: TStrings): TModalResult;
|
||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
j: Integer;
|
j: Integer;
|
||||||
CurUnitName: String;
|
CurUnitName: String;
|
||||||
AnotherUnitName: String;
|
AnotherUnitName: String;
|
||||||
begin
|
begin
|
||||||
|
if SearchInPPUs=nil then
|
||||||
|
SearchInPPUs:=SearchForPPUs;
|
||||||
|
|
||||||
// resolve links and remove doubles
|
// resolve links and remove doubles
|
||||||
ResolveLinksInFileList(PPUs,true);
|
ResolveLinksInFileList(SearchForPPUs,true);
|
||||||
RemoveDoubles(PPUs);
|
RemoveDoubles(SearchForPPUs);
|
||||||
for i:=1 to PPUs.Count-1 do begin
|
if SearchForPPUs<>SearchInPPUs then begin
|
||||||
CurUnitName:=ExtractFileNameOnly(PPUs[i]);
|
ResolveLinksInFileList(SearchInPPUs,true);
|
||||||
j:=i-1;
|
RemoveDoubles(SearchInPPUs);
|
||||||
while j>0 do begin
|
end;
|
||||||
AnotherUnitName:=ExtractFileNameOnly(PPUs[j]);
|
|
||||||
|
for i:=1 to SearchForPPUs.Count-1 do begin
|
||||||
|
CurUnitName:=ExtractFileNameOnly(SearchForPPUs[i]);
|
||||||
|
if SearchForPPUs=SearchInPPUs then
|
||||||
|
j:=i-1
|
||||||
|
else
|
||||||
|
j:=SearchInPPUs.Count-1;
|
||||||
|
while j>=0 do begin
|
||||||
|
AnotherUnitName:=ExtractFileNameOnly(SearchInPPUs[j]);
|
||||||
if CompareText(AnotherUnitName,CurUnitName)=0 then begin
|
if CompareText(AnotherUnitName,CurUnitName)=0 then begin
|
||||||
// unit exists twice
|
// unit exists twice
|
||||||
AddWarning('ppu exists twice: '+PPUs[i]+', '+PPUs[j]);
|
AddWarning('ppu exists twice: '+SearchForPPUs[i]+', '+SearchInPPUs[j]);
|
||||||
break;
|
break;
|
||||||
end;
|
end;
|
||||||
dec(j);
|
dec(j);
|
||||||
@ -748,6 +760,10 @@ begin
|
|||||||
Result:=CheckForAmbiguousPPUs(Target_PPUs);
|
Result:=CheckForAmbiguousPPUs(Target_PPUs);
|
||||||
if not (Result in [mrOk,mrIgnore]) then exit;
|
if not (Result in [mrOk,mrIgnore]) then exit;
|
||||||
|
|
||||||
|
// check if there are ambiguous ppu in fpc and project/package unit path
|
||||||
|
Result:=CheckForAmbiguousPPUs(FPC_PPUs,Target_PPUs);
|
||||||
|
if not (Result in [mrOk,mrIgnore]) then exit;
|
||||||
|
|
||||||
// compile bogus file
|
// compile bogus file
|
||||||
Result:=CheckCompileBogusFile(CompilerFilename);
|
Result:=CheckCompileBogusFile(CompilerFilename);
|
||||||
if not (Result in [mrOk,mrIgnore]) then exit;
|
if not (Result in [mrOk,mrIgnore]) then exit;
|
||||||
|
Loading…
Reference in New Issue
Block a user