mirror of https://gitlab.com/basile.b/dexed.git
runnables, prevent additional first line switches to include "-of"
This commit is contained in:
parent
ad19ed1c6b
commit
e10c323c74
|
@ -1980,9 +1980,10 @@ end;
|
||||||
procedure TCEMainForm.compileRunnable(unittest: boolean = false);
|
procedure TCEMainForm.compileRunnable(unittest: boolean = false);
|
||||||
var
|
var
|
||||||
i: integer;
|
i: integer;
|
||||||
|
fname: string;
|
||||||
dmdproc: TCEProcess;
|
dmdproc: TCEProcess;
|
||||||
lst: TStringList;
|
lst: TStringList = nil;
|
||||||
fname, firstlineFlags: string;
|
firstLineFlags: string = '';
|
||||||
begin
|
begin
|
||||||
|
|
||||||
fMsgs.clearByData(fDoc);
|
fMsgs.clearByData(fDoc);
|
||||||
|
@ -1992,20 +1993,19 @@ begin
|
||||||
|
|
||||||
firstlineFlags := fDoc.Lines[0];
|
firstlineFlags := fDoc.Lines[0];
|
||||||
i := firstlineFlags.length;
|
i := firstlineFlags.length;
|
||||||
if ( i > 18) then
|
if (i > 18) and (firstlineFlags.upperCase[1..17] = '#!RUNNABLE-FLAGS:') then
|
||||||
begin
|
begin
|
||||||
if firstlineFlags.upperCase[1..17] = '#!RUNNABLE-FLAGS:' then
|
firstlineFlags := fSymStringExpander.expand(firstlineFlags[18..i]);
|
||||||
firstlineFlags := fSymStringExpander.expand(firstlineFlags[18..i])
|
|
||||||
else firstlineFlags:= '';
|
|
||||||
end else firstlineFlags:= '';
|
|
||||||
|
|
||||||
|
|
||||||
lst := TStringList.Create;
|
lst := TStringList.Create;
|
||||||
|
CommandToList(firstlineFlags, lst);
|
||||||
|
for i:= lst.Count-1 downto 0 do
|
||||||
|
if (lst[i].length > 2) and (lst[i][1..3] = '-of') then
|
||||||
|
lst.Delete(i);
|
||||||
|
end;
|
||||||
|
|
||||||
dmdproc := TCEProcess.Create(nil);
|
dmdproc := TCEProcess.Create(nil);
|
||||||
try
|
try
|
||||||
|
|
||||||
fMsgs.message('compiling ' + shortenPath(fDoc.fileName, 25), fDoc, amcEdit, amkInf);
|
fMsgs.message('compiling ' + shortenPath(fDoc.fileName, 25), fDoc, amcEdit, amkInf);
|
||||||
|
|
||||||
if fDoc.fileName.fileExists then
|
if fDoc.fileName.fileExists then
|
||||||
fDoc.save
|
fDoc.save
|
||||||
else
|
else
|
||||||
|
@ -2025,7 +2025,7 @@ begin
|
||||||
dmdproc.Parameters.Add('-of' + fname + exeExt);
|
dmdproc.Parameters.Add('-of' + fname + exeExt);
|
||||||
dmdproc.Parameters.Add('-J' + fDoc.fileName.extractFilePath);
|
dmdproc.Parameters.Add('-J' + fDoc.fileName.extractFilePath);
|
||||||
dmdproc.Parameters.AddText(fRunnableSw);
|
dmdproc.Parameters.AddText(fRunnableSw);
|
||||||
CommandToList(firstlineFlags, lst);
|
if lst.isNotNil and (lst.Count <> 0) then
|
||||||
dmdproc.Parameters.AddStrings(lst);
|
dmdproc.Parameters.AddStrings(lst);
|
||||||
if unittest then
|
if unittest then
|
||||||
begin
|
begin
|
||||||
|
@ -2056,6 +2056,7 @@ begin
|
||||||
|
|
||||||
finally
|
finally
|
||||||
dmdproc.Free;
|
dmdproc.Free;
|
||||||
|
if lst.isNotNil then
|
||||||
lst.Free;
|
lst.Free;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
Loading…
Reference in New Issue