mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 17:39:20 +02:00
IDE: clean up
git-svn-id: trunk@42497 -
This commit is contained in:
parent
02345b4e6a
commit
b35e91f5b7
@ -1015,22 +1015,18 @@ function TCompilerOptReader.ReadAndParseOptions: TModalResult;
|
|||||||
var
|
var
|
||||||
Lines: TStringList;
|
Lines: TStringList;
|
||||||
ParsedTarget: String;
|
ParsedTarget: String;
|
||||||
t: array[0..5] of TDateTime;
|
|
||||||
i: Integer;
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
OptionIdCounter := 0;
|
OptionIdCounter := 0;
|
||||||
fErrorMsg := '';
|
fErrorMsg := '';
|
||||||
t[0]:=Now;
|
|
||||||
if fCompilerExecutable = '' then
|
if fCompilerExecutable = '' then
|
||||||
fCompilerExecutable := 'fpc'; // Let's hope "fpc" is found in PATH.
|
fCompilerExecutable := 'fpc'; // Let's hope "fpc" is found in PATH.
|
||||||
ParsedTarget := '-T$(TargetOS) -P$(TargetCPU)';
|
ParsedTarget := '-T$(TargetOS) -P$(TargetCPU)';
|
||||||
if not GlobalMacroList.SubstituteStr(ParsedTarget) then
|
if not GlobalMacroList.SubstituteStr(ParsedTarget) then
|
||||||
raise Exception.CreateFmt('ReadAndParseOptions: Cannot substitute macros "%s".',
|
raise Exception.CreateFmt('ReadAndParseOptions: Cannot substitute macros "%s".',
|
||||||
[ParsedTarget]);
|
[ParsedTarget]);
|
||||||
t[1]:=Now;
|
|
||||||
// FPC with option -i
|
// FPC with option -i
|
||||||
Lines:=RunTool(fCompilerExecutable, ParsedTarget + ' -i');
|
Lines:=RunTool(fCompilerExecutable, ParsedTarget + ' -i');
|
||||||
t[2]:=Now;
|
|
||||||
try
|
try
|
||||||
if Lines = Nil then Exit(mrCancel);
|
if Lines = Nil then Exit(mrCancel);
|
||||||
Result := ParseI(Lines);
|
Result := ParseI(Lines);
|
||||||
@ -1038,21 +1034,14 @@ begin
|
|||||||
finally
|
finally
|
||||||
Lines.Free;
|
Lines.Free;
|
||||||
end;
|
end;
|
||||||
t[3]:=Now;
|
|
||||||
// FPC with option -h
|
// FPC with option -h
|
||||||
Lines:=RunTool(fCompilerExecutable, ParsedTarget + ' -h');
|
Lines:=RunTool(fCompilerExecutable, ParsedTarget + ' -h');
|
||||||
t[4]:=Now;
|
|
||||||
try
|
try
|
||||||
if Lines = Nil then Exit(mrCancel);
|
if Lines = Nil then Exit(mrCancel);
|
||||||
Result := ParseH(Lines);
|
Result := ParseH(Lines);
|
||||||
finally
|
finally
|
||||||
Lines.Free;
|
Lines.Free;
|
||||||
end;
|
end;
|
||||||
t[5]:=Now;
|
|
||||||
debugln(['TCompilerOptReader.ReadAndParseOptions ']);
|
|
||||||
for i:=1 to high(t) do begin
|
|
||||||
debugln([' ',i,' ',round((t[i]-t[i-1])*86400*1000)]);
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCompilerOptReader.FilterOptions(aFilter: string; aOnlySelected: Boolean): Boolean;
|
function TCompilerOptReader.FilterOptions(aFilter: string; aOnlySelected: Boolean): Boolean;
|
||||||
@ -1215,7 +1204,6 @@ begin
|
|||||||
fReader.ErrorMsg := 'Error parsing options: '+E.Message;
|
fReader.ErrorMsg := 'Error parsing options: '+E.Message;
|
||||||
end;
|
end;
|
||||||
fReadTime := Now-StartTime;
|
fReadTime := Now-StartTime;
|
||||||
debugln(['TCompilerOptThread.Execute ',round(fReadTime*86400*1000)]);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user