Lazarus

Using the Lazarus IDE => General => Topic started by: loaded on June 12, 2021, 03:20:01 pm

Title: [Solved] How to Build for Multi-Platform.
Post by: loaded on June 12, 2021, 03:20:01 pm
Hi All,
my apps are compiled as i386 (32 Bit) by default.
I compile as 64 bit by selecting x86_64 (64 Bit) as the target from the setting section of the project options. By putting the $(TargetCPU) plugin at the end of the target file name to be compiled in the settings section, I can visually understand the structure of the compiled exes.
Code: Pascal  [Select][+][-]
  1. Compile Project, Target: project1_i386.exe: Success
  2. Compile Project, OS: win64, CPU: x86_64, Target: Project1_x86_64.exe: Success
  3.  
So can I do multiple compilations at the same time?
So, is it possible to compile both 32 and 64 at the same time without manually selecting it?
Title: Re: How to Build for Multi-Platform.
Post by: MarkMLl on June 12, 2021, 03:30:54 pm
Bear in mind that you're not telling us what your development and target platforms are.

/If/ you were running Lazarus (and bear in mind that you're not telling us what your development and target platforms are) there's a "build project group" or similar extension which might help... I'm not saying it will, just that it's worth looking at.

Otherwise a makefile should do it, if such things are available on whatever... I think you get the idea.

MarkMLl


Title: Re: How to Build for Multi-Platform.
Post by: loaded on June 12, 2021, 03:39:54 pm
Thank you for the reply MarkMLl
I'm compiling for Windows on Windows.
My goal is to compile for 32 and 64 bit at the same time.
Otherwise a makefile should do it, if such things are available on whatever... I think you get the idea.
sorry i didn't understand  ;D
Title: Re: How to Build for Multi-Platform.
Post by: JuhaManninen on June 12, 2021, 07:09:00 pm
So can I do multiple compilations at the same time?
So, is it possible to compile both 32 and 64 at the same time without manually selecting it?
Build modes are the way to go. The Lazarus Run menu also has "Compile many modes ...".

... there's a "build project group" or similar extension which might help... I'm not saying it will, just that it's worth looking at.
Project groups are provided by an IDE plugin package but they are meant for a different purpose.
They are for projects closely related to each other, for example a main project and a unit test project for its code.
Title: Re: How to Build for Multi-Platform.
Post by: loaded on June 12, 2021, 07:51:02 pm
Thank you for the reply JuhaManninen
Build modes are the way to go. The Lazarus Run menu also has "Compile many modes ...".
"Compile many modes ...",  This mod seems to be disabled for me.
I will do the necessary research to activate and run, thank you.
Title: Re: How to Build for Multi-Platform.
Post by: lucamar on June 12, 2021, 09:46:06 pm
"Compile many modes ...",  This mod seems to be disabled for me.
I will do the necessary research to activate and run, thank you.

"Compile many modes ..." is enabled only if there are more than one "mode" in the project options, which is logical enough ;)

Just select "Project->Project Options", then "Compiler options" and click on the "..." button besides "Build modes". As soon as you have at least two "Build modes" set up the menu item should become enabled.
Title: Re: How to Build for Multi-Platform.
Post by: VisualLab on June 12, 2021, 10:27:55 pm
Could use a way to set basic compile options (build, target) in Lazarus similar to Delphi (panel "Projects"). I mean something similar to:
Title: Re: How to Build for Multi-Platform.
Post by: loaded on June 12, 2021, 10:47:46 pm
Thank you very much lucamar and VisualLab for the answers.

The answer lucamar gave was what I wanted.

"Compile many modes ..." is enabled only if there are more than one "mode" in the project options, which is logical enough ;)

Just select "Project->Project Options", then "Compiler options" and click on the "..." button besides "Build modes". As soon as you have at least two "Build modes" set up the menu item should become enabled.

Long live the Lazarus writers and the very wise and good people here. :)
Title: Re: How to Build for Multi-Platform.
Post by: JuhaManninen on June 13, 2021, 11:22:48 am
Could use a way to set basic compile options (build, target) in Lazarus similar to Delphi (panel "Projects"). I mean something similar to:
I haven't used Delphi for a while.
Is it so that Delphi's "Target Platform" is not part of the "Build Configuration" but other options are?
Lazarus project options have :
Remember, FPC / Lazarus is a fully cross-platform system unlike Delphi. Which target options would you put in the project manager?
This could be implemented as an IDE plugin package. It would inject stuff to the project manager window. If the current plugin API is not enough, it can be extended. Patches are welcome.

Currently you can create 2 build modes for the targets and switch between them using a toolbutton with a nice dropdown list in the IDE Coolbar. It does not become much easier.
TinyPortal © 2005-2018