Recent

Author Topic: [Solved] How to Build for Multi-Platform.  (Read 3941 times)

loaded

  • Full Member
  • ***
  • Posts: 230
[Solved] How to Build for Multi-Platform.
« 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?
« Last Edit: June 12, 2021, 10:48:24 pm by loaded »
Installing the spelling, google translate is used :)

MarkMLl

  • Hero Member
  • *****
  • Posts: 2853
Re: How to Build for Multi-Platform.
« Reply #1 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


Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

loaded

  • Full Member
  • ***
  • Posts: 230
Re: How to Build for Multi-Platform.
« Reply #2 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
Installing the spelling, google translate is used :)

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3939
  • I like bugs.
Re: How to Build for Multi-Platform.
« Reply #3 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.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

loaded

  • Full Member
  • ***
  • Posts: 230
Re: How to Build for Multi-Platform.
« Reply #4 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.
Installing the spelling, google translate is used :)

lucamar

  • Hero Member
  • *****
  • Posts: 4150
Re: How to Build for Multi-Platform.
« Reply #5 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.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

VisualLab

  • New Member
  • *
  • Posts: 11
Re: How to Build for Multi-Platform.
« Reply #6 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:

loaded

  • Full Member
  • ***
  • Posts: 230
Re: How to Build for Multi-Platform.
« Reply #7 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. :)
Installing the spelling, google translate is used :)

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3939
  • I like bugs.
Re: How to Build for Multi-Platform.
« Reply #8 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 :
  • Target OS
  • Target CPU family
  • Target processor
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.
« Last Edit: June 13, 2021, 12:55:17 pm by JuhaManninen »
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

 

TinyPortal © 2005-2018