Discussion:
Lazarus IDE / Packages - SetAlternativeCompile for Before and After
(too old to reply)
Mathias
2018-09-09 16:25:16 UTC
Permalink
Hello Lazarus team,

i build an AVR package for the Lazarus IDE.
It is absolutely necessary, that I can enter something with compiler
commands, with "afterwards". There comes in an avrdude call.

This works, I made the following changes in Lazarus.
It would be nice who the Lazarus team could put this firmly in place.

Even more ingenious would be who you could even read it out, eg. with
"GetAlternativeCompile"

The current state of my AVR package I have on GitHub.
https://github.com/sechshelme/AVR-Lazarus/tree/master/AVR_Package



// === Lazarus 1.9.0 r58920M ===



// components/ideintf/compoptsintf.pas: Zeile 454

// old

procedureSetAlternativeCompile(constCommand:string;
ScanFPCMsgs:boolean); virtual; abstract;// disable normal compile and call this instead

// new

procedureSetAlternativeCompile(constCommand:string;
ScanFPCMsgs:boolean; After:Boolean=False); virtual; abstract;// disable normal compile and call this instead





// ide/compileroptions.pp: Zeile 499 + 3695



// old


procedureSetAlternativeCompile(constCommand:string;
ScanFPCMsgs:boolean); override;

.....

procedureTBaseCompilerOptions.SetAlternativeCompile(constCommand:string;

  ScanFPCMsgs:boolean);

begin

  CompilerPath:='';

  ExecuteBefore.Command:=Command;

ifScanFPCMsgsthen

    ExecuteBefore.Parsers.Text:=SubToolFPC+LineEnding+SubToolMake

else

    ExecuteBefore.Parsers.Clear;

end;



// new

procedureSetAlternativeCompile(constCommand:string;
ScanFPCMsgs:boolean; After:Boolen); override;

.....

procedureTBaseCompilerOptions.SetAlternativeCompile(constCommand:string;

  ScanFPCMsgs:boolean; After:Boolen);

begin

  CompilerPath:='';



ifAfterthenbegin

    ExecuteAfter.Command:=Command;

ifScanFPCMsgsthen

      ExecuteAfter.Parsers.Text:=SubToolFPC+LineEnding+SubToolMake

else

      ExecuteAfter.Parsers.Clear;

endelsebegin

    ExecuteBefore.Command:=Command;

ifScanFPCMsgsthen

      ExecuteBefore.Parsers.Text:=SubToolFPC+LineEnding+SubToolMake

else

      ExecuteBefore.Parsers.Clear;

end;

end;



// ide/project.pp: Zeile 551 + 6255



// old

procedureSetAlternativeCompile(constCommand:string;
ScanFPCMsgs:boolean); override;

.....

procedureTProjectCompilerOptions.SetAlternativeCompile(constCommand:string;

  ScanFPCMsgs:boolean);

begin

inheritedSetAlternativeCompile(Command,ScanFPCMsgs);

  CompileReasons:=[];

end;



// new

procedureSetAlternativeCompile(constCommand:string;
ScanFPCMsgs:boolean; After:Boolean); override;

.....

procedureTProjectCompilerOptions.SetAlternativeCompile(constCommand:string;

  ScanFPCMsgs:boolean; After:Boolean);

begin

inheritedSetAlternativeCompile(Command,ScanFPCMsgs,After);

  CompileReasons:=[];

end;
Michael Van Canneyt
2018-09-09 16:33:49 UTC
Permalink
I think you mailed to the wrong list ?

Michael.
Post by Mathias
Hello Lazarus team,
i build an AVR package for the Lazarus IDE.
It is absolutely necessary, that I can enter something with compiler
commands, with "afterwards". There comes in an avrdude call.
This works, I made the following changes in Lazarus.
It would be nice who the Lazarus team could put this firmly in place.
Even more ingenious would be who you could even read it out, eg. with
"GetAlternativeCompile"
The current state of my AVR package I have on GitHub.
https://github.com/sechshelme/AVR-Lazarus/tree/master/AVR_Package
// === Lazarus 1.9.0 r58920M ===
// components/ideintf/compoptsintf.pas: Zeile 454
// old
procedureSetAlternativeCompile(constCommand:string;
ScanFPCMsgs:boolean); virtual; abstract;// disable normal compile and
call this instead
// new
procedureSetAlternativeCompile(constCommand:string;
ScanFPCMsgs:boolean; After:Boolean=False); virtual; abstract;// disable
normal compile and call this instead
// ide/compileroptions.pp: Zeile 499 + 3695
// old
procedureSetAlternativeCompile(constCommand:string;
ScanFPCMsgs:boolean); override;
.....
procedureTBaseCompilerOptions.SetAlternativeCompile(constCommand:string;
  ScanFPCMsgs:boolean);
begin
  CompilerPath:='';
  ExecuteBefore.Command:=Command;
ifScanFPCMsgsthen
    ExecuteBefore.Parsers.Text:=SubToolFPC+LineEnding+SubToolMake
else
    ExecuteBefore.Parsers.Clear;
end;
// new
procedureSetAlternativeCompile(constCommand:string;
ScanFPCMsgs:boolean; After:Boolen); override;
.....
procedureTBaseCompilerOptions.SetAlternativeCompile(constCommand:string;
  ScanFPCMsgs:boolean; After:Boolen);
begin
  CompilerPath:='';
ifAfterthenbegin
    ExecuteAfter.Command:=Command;
ifScanFPCMsgsthen
      ExecuteAfter.Parsers.Text:=SubToolFPC+LineEnding+SubToolMake
else
      ExecuteAfter.Parsers.Clear;
endelsebegin
    ExecuteBefore.Command:=Command;
ifScanFPCMsgsthen
      ExecuteBefore.Parsers.Text:=SubToolFPC+LineEnding+SubToolMake
else
      ExecuteBefore.Parsers.Clear;
end;
end;
// ide/project.pp: Zeile 551 + 6255
// old
procedureSetAlternativeCompile(constCommand:string;
ScanFPCMsgs:boolean); override;
.....
procedureTProjectCompilerOptions.SetAlternativeCompile(constCommand:string;
  ScanFPCMsgs:boolean);
begin
inheritedSetAlternativeCompile(Command,ScanFPCMsgs);
  CompileReasons:=[];
end;
// new
procedureSetAlternativeCompile(constCommand:string;
ScanFPCMsgs:boolean; After:Boolean); override;
.....
procedureTProjectCompilerOptions.SetAlternativeCompile(constCommand:string;
  ScanFPCMsgs:boolean; After:Boolean);
begin
inheritedSetAlternativeCompile(Command,ScanFPCMsgs,After);
  CompileReasons:=[];
end;
Christo Crause
2018-09-10 05:14:25 UTC
Permalink
Post by Mathias
Hello
Lazarus team,
i build an AVR package for the Lazarus IDE.
It is absolutely necessary, that I can enter something with
compiler commands, with "afterwards". There comes in an
avrdude call.
Try posting your question on the Lazarus forum :
http://forum.lazarus.freepascal.org/index.php/board,13.0.html

Loading...