ide: respect output filter aborting during compilation

git-svn-id: trunk@25404 -
This commit is contained in:
paul 2010-05-14 16:02:32 +00:00
parent db0addae35
commit 8ba105a104

View File

@ -204,11 +204,17 @@ begin
OutputFilter.Options:=[ofoSearchForFPCMessages,ofoExceptionOnError]; OutputFilter.Options:=[ofoSearchForFPCMessages,ofoExceptionOnError];
OutputFilter.CompilerOptions:=AProject.CompilerOptions; OutputFilter.CompilerOptions:=AProject.CompilerOptions;
{$IFDEF WithAsyncCompile} {$IFDEF WithAsyncCompile}
if aFinishedCallback <> nil then begin if aFinishedCallback <> nil then
begin
OutputFilter.ExecuteAsyncron(TheProcess, @CompilationFinished, Self); OutputFilter.ExecuteAsyncron(TheProcess, @CompilationFinished, Self);
end else end
else
{$ENDIF} {$ENDIF}
OutputFilter.Execute(TheProcess,Self); if not OutputFilter.Execute(TheProcess,Self) then
if OutputFilter.Aborted then
Result := mrAbort
else
Result := mrCancel;
end else begin end else begin
TheProcess.Execute; TheProcess.Execute;
end; end;
@ -244,17 +250,22 @@ end;
{$IFDEF WithAsyncCompile} {$IFDEF WithAsyncCompile}
procedure TCompiler.CompilationFinished(Sender: TObject); procedure TCompiler.CompilationFinished(Sender: TObject);
begin begin
FASyncResult:= mrOK; if OutputFilter.Aborted then
if TheProcess.Running then begin FASyncrResult := mrAbort
else
FASyncResult := mrOK;
if TheProcess.Running then
begin
TheProcess.WaitOnExit; TheProcess.WaitOnExit;
if not (TheProcess.ExitStatus in [0,1]) then begin if (FASyncResult = mrOk) and not (TheProcess.ExitStatus in [0,1]) then
WriteError(Format(listCompilerInternalError,[TheProcess.ExitStatus])); begin
FASyncResult:=mrCancel; WriteError(Format(listCompilerInternalError, [TheProcess.ExitStatus]));
FASyncResult := mrCancel;
end; end;
end; end;
DebugLn('[TCompiler.Compile] Async end'); DebugLn('[TCompiler.Compile] Async end');
if assigned(FFinishedCallback) then if Assigned(FFinishedCallback) then
FFinishedCallback(Self); FFinishedCallback(Self);
end; end;
{$ENDIF} {$ENDIF}
@ -262,9 +273,8 @@ end;
procedure TCompiler.WriteError(const Msg: string); procedure TCompiler.WriteError(const Msg: string);
begin begin
DebugLn('TCompiler.WriteError ',Msg); DebugLn('TCompiler.WriteError ',Msg);
if OutputFilter<>nil then begin if OutputFilter <> nil then
OutputFilter.ReadConstLine(Msg,true); OutputFilter.ReadConstLine(Msg, True);
end;
end; end;