IDE: external tools: added TAbstractExternalTool.ReadStdOutBeforeErr, changed default to read stderr before out, needed by FPC linker errors

git-svn-id: trunk@47955 -
This commit is contained in:
mattias 2015-02-23 09:56:49 +00:00
parent c085a5c2d6
commit ccfdda027d
2 changed files with 9 additions and 2 deletions

View File

@ -447,6 +447,7 @@ type
FFreeData: boolean;
FGroup: TExternalToolGroup;
FHint: string;
FReadStdOutBeforeErr: boolean;
FResolveMacrosOnExecute: boolean;
FThread: TThread;
FWorkerDirectory: string;
@ -530,6 +531,7 @@ type
property Terminated: boolean read FTerminated;
property ExitStatus: integer read FExitStatus write FExitStatus;
property ErrorMessage: string read FErrorMessage write FErrorMessage; // error executing tool
property ReadStdOutBeforeErr: boolean read FReadStdOutBeforeErr write FReadStdOutBeforeErr;
// output
property WorkerOutput: TStrings read FWorkerOutput; // the raw output

View File

@ -1630,8 +1630,13 @@ begin
StdErrLine:='';
LastUpdate:=GetTickCount64;
while (Tool<>nil) and (Tool.Stage=etsRunning) do begin
HasOutput:=ReadInputPipe(Tool.Process.Output,OutputLine)
or ReadInputPipe(Tool.Process.Stderr,StdErrLine);
if Tool.ReadStdOutBeforeErr then begin
HasOutput:=ReadInputPipe(Tool.Process.Output,OutputLine)
or ReadInputPipe(Tool.Process.Stderr,StdErrLine);
end else begin
HasOutput:=ReadInputPipe(Tool.Process.Stderr,StdErrLine)
or ReadInputPipe(Tool.Process.Output,OutputLine);
end;
if (not HasOutput) then begin
// no more pending output
if not Tool.Process.Running then break;