IDE: make msg parser: parse make:

git-svn-id: trunk@60315 -
This commit is contained in:
mattias 2019-02-03 18:30:03 +00:00
parent d1d37c9983
commit 4c9dda34f5

View File

@ -252,21 +252,33 @@ procedure TIDEMakeParser.ReadLine(Line: string; OutputIndex: integer;
make[1]: Leaving directory `<filename>' make[1]: Leaving directory `<filename>'
make[1]: *** [<filename>] Killed make[1]: *** [<filename>] Killed
make <command> make <command>
make[2]: *** [lazarus] Error 1
make[1]: *** [idepkg] Error 2
make: *** [idepkg] Error 2
/bin/cp <options> /bin/cp <options>
} }
const const
EnterDirPattern = ']: Entering directory `'; EnterDirPattern = ': Entering directory `';
LeavingDirPattern = ']: Leaving directory `'; LeavingDirPattern = ': Leaving directory `';
MakeMsgPattern = ']: *** ['; MakeMsgPattern = ': *** [';
var var
MsgLine: TMessageLine; MsgLine: TMessageLine;
p: PChar; p: PChar;
Filename, Dir: string; Filename, Dir: string;
Run: PChar; Run, OldP: PChar;
begin begin
if Line='' then exit; if Line='' then exit;
p:=PChar(Line); p:=PChar(Line);
if ReadString(p,'make[') or ReadString(p,'make.exe[') then begin OldP:=p;
if ReadString(p,'make.exe') then
inc(p,8)
else if ReadString(p,'make') then
inc(p,4)
else if ReadString(p,'gmake') then
inc(p,5);
if (p>OldP) and (p^ in ['[',':']) then begin
// e.g. make[2]: *** [lazarus] Error 1
Handled:=true; Handled:=true;
MsgLine:=CreateMsgLine(OutputIndex); MsgLine:=CreateMsgLine(OutputIndex);
@ -274,7 +286,11 @@ begin
MsgLine.Urgency:=mluVerbose; MsgLine.Urgency:=mluVerbose;
MsgLine.Msg:=Line; MsgLine.Msg:=Line;
if p^='[' then
begin
while not (p^ in [']',#0]) do inc(p); while not (p^ in [']',#0]) do inc(p);
if p^=']' then inc(p);
end;
if ReadString(p,EnterDirPattern) then begin if ReadString(p,EnterDirPattern) then begin
// entering directory // entering directory
MsgLine.MsgID:=MakeMsgIDEnteringDirectory; MsgLine.MsgID:=MakeMsgIDEnteringDirectory;
@ -302,7 +318,7 @@ begin
end; end;
AddMsgLine(MsgLine); AddMsgLine(MsgLine);
exit; exit;
end else if ReadString(p,'make ') then begin end else if (p>OldP) and (p^=' ') then begin
// e.g. make --assume-new=lazbuild.lpr lazbuild // e.g. make --assume-new=lazbuild.lpr lazbuild
Handled:=true; Handled:=true;
@ -314,6 +330,7 @@ begin
exit; exit;
end; end;
p:=OldP;
if not (p^ in [#0,' ',#9]) then begin if not (p^ in [#0,' ',#9]) then begin
// check for command <option> // check for command <option>
Run:=p; Run:=p;