mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-13 12:49:20 +02:00
* Do not use TProcess to run the compiler when it is not available
git-svn-id: trunk@16958 -
This commit is contained in:
parent
ecc9deeea3
commit
36ec05961f
@ -1162,6 +1162,7 @@ Const
|
|||||||
Helpers
|
Helpers
|
||||||
****************************************************************************}
|
****************************************************************************}
|
||||||
|
|
||||||
|
{$ifdef HAS_UNIT_PROCESS}
|
||||||
function ExecuteFPC(Verbose: boolean; const Path: string; const ComLine: string; ConsoleOutput: TMemoryStream): integer;
|
function ExecuteFPC(Verbose: boolean; const Path: string; const ComLine: string; ConsoleOutput: TMemoryStream): integer;
|
||||||
var
|
var
|
||||||
P: TProcess;
|
P: TProcess;
|
||||||
@ -1263,6 +1264,7 @@ begin
|
|||||||
P.Free;
|
P.Free;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
{$endif HAS_UNIT_PROCESS}
|
||||||
|
|
||||||
function ParsecompilerOutput(M: TMemoryStream; Verbose: boolean): string;
|
function ParsecompilerOutput(M: TMemoryStream; Verbose: boolean): string;
|
||||||
type
|
type
|
||||||
@ -3508,7 +3510,11 @@ begin
|
|||||||
// We should check cmd for spaces, and move all after first space to args.
|
// We should check cmd for spaces, and move all after first space to args.
|
||||||
ConsoleOutput := TMemoryStream.Create;
|
ConsoleOutput := TMemoryStream.Create;
|
||||||
try
|
try
|
||||||
|
{$ifdef HAS_UNIT_PROCESS}
|
||||||
E:=ExecuteFPC(Verbose, cmd, args, ConsoleOutput);
|
E:=ExecuteFPC(Verbose, cmd, args, ConsoleOutput);
|
||||||
|
{$else}
|
||||||
|
E:=ExecuteProcess(cmd,args);
|
||||||
|
{$endif}
|
||||||
If (E<>0) and (not IgnoreError) then
|
If (E<>0) and (not IgnoreError) then
|
||||||
begin
|
begin
|
||||||
if trim(Args)<>'' then
|
if trim(Args)<>'' then
|
||||||
|
Loading…
Reference in New Issue
Block a user