Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2018-09

Lazarus IDE / Packages - SetAlternativeCompile for Before and After

3 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

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;

Reply by email

Michael Van Canneyt
to Mathias

I think you mailed to the wrong list ?

Michael.

Mathias wrote 155 lines
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;

Reply by email