mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-03 23:50:36 +02:00
instantfpc: fixed showing compiler error
git-svn-id: trunk@25340 -
This commit is contained in:
parent
add4aa10df
commit
1e48781694
@ -282,6 +282,15 @@ var
|
||||
pid: SizeUInt;
|
||||
BuildDir: String;
|
||||
BuildOutputFilename: String;
|
||||
|
||||
procedure CleanUp;
|
||||
begin
|
||||
if BuildDir<>'' then begin
|
||||
// delete build directory
|
||||
DeleteDirectory(BuildDir);
|
||||
end;
|
||||
end;
|
||||
|
||||
begin
|
||||
Compiler:=GetCompiler;
|
||||
pid:=GetProcessID;
|
||||
@ -307,6 +316,7 @@ begin
|
||||
Halt(1);
|
||||
end;
|
||||
end;
|
||||
try
|
||||
CompParams:=GetCompilerParameters(CacheFilename,BuildDir,BuildOutputFilename);
|
||||
Proc:=TProcess.Create(nil);
|
||||
Proc.CommandLine:=Compiler+' '+CompParams;
|
||||
@ -320,21 +330,23 @@ begin
|
||||
if Count>0 then
|
||||
ss.write(buf,count);
|
||||
until Count=0;
|
||||
if (not Proc.WaitOnExit) or (Proc.ExitStatus<>0) then begin
|
||||
WriteCompilerOutput(SrcFilename,BuildOutputFilename,ss.DataString);
|
||||
CleanUp;
|
||||
Halt(1);
|
||||
end;
|
||||
if BuildDir<>'' then begin
|
||||
// move from build directory to cache
|
||||
if not RenameFile(BuildOutputFilename,OutputFilename) then begin
|
||||
writeln('unable to move "',BuildOutputFilename,'" to "',OutputFilename,'"');
|
||||
Halt(1);
|
||||
end;
|
||||
// delete build directory
|
||||
DeleteDirectory(BuildDir);
|
||||
end;
|
||||
if (not Proc.WaitOnExit) or (Proc.ExitStatus<>0) then begin
|
||||
WriteCompilerOutput(SrcFilename,CacheFilename,ss.DataString);
|
||||
Halt(1);
|
||||
end;
|
||||
ss.Free;
|
||||
Proc.Free;
|
||||
finally
|
||||
CleanUp;
|
||||
end;
|
||||
end;
|
||||
|
||||
function GetCompilerParameters(const SrcFilename, OutputDirectory,
|
||||
|
Loading…
Reference in New Issue
Block a user