instantfpc: added option --skip-run

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2015 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
mgaertner
2011-09-26 10:35:27 +00:00
parent d28764821b
commit 26fd1a86b9

View File

@ -68,11 +68,13 @@ begin
writeln;
writeln(' --compiler=<path to compiler>');
writeln(' Normally fpc is searched in PATH and used as compiler.');
writeln;
writeln(' --skip-run');
writeln(' Do not execute the program. Useful to test if script compiles.');
Halt(0);
end;
Procedure DisplayCache;
begin
write(GetCacheDir);
Halt(0);
@ -88,11 +90,11 @@ var
OutputFilename: String;
ExeExt: String;
E : String;
RunIt: boolean = true;
// Return true if filename found.
Function InterpretParam(p : String) : boolean;
begin
Result:=False;
if (P='') then exit;
@ -115,7 +117,11 @@ begin
delete(P,1,12);
SetCacheDir(p);
end
else if (P<>'') and (p[1]<>'-') then
else if p='--skip-run' then
begin
RunIt:=false;
end
else if (P<>'') and (p[1]<>'-') then
begin
Filename:=p;
Result:=True;
@ -182,7 +188,8 @@ begin
Compile(CacheFilename,OutputFilename);
end;
// run
Run(OutputFilename);
if RunIt then
Run(OutputFilename);
finally
// memory is freed by OS, but for debugging puposes you can do it manually
{$IFDEF IFFreeMem}