Author Topic: Managing Multiple Targets  (Read 333 times)

Grahame Grieve

  • Full Member
  • ***
  • Posts: 111
Managing Multiple Targets
« on: October 01, 2020, 01:07:56 am »
I have a project that compiles for win32, win64, linux/64, and OSX (64bit). I want to routinely switch between these platforms to make sure that it compiles for all of them. Right now, I have to go to project options, and change 3 things: the Target OS. the target CPU family, and the LCL widget set.

Of course I can keep doing this, but is there a quicker way? One where I create combinations of these 3 and just switch between them?


  • Hero Member
  • *****
  • Posts: 792
Re: Managing Multiple Targets
« Reply #1 on: October 01, 2020, 02:22:28 am »
If you create different build modes for each target /widgetset/cpu and give each build mode taget exe a slightly different name, you can then either compile each one, or compile many builds at the same time.

Project Options->Compiler OPtions you will see the build modes drop down at the top click the button to the right to create as many build modes as you want.
In each build mode if you click the Project Options->Compiler Options->Paths you will see an entry for Target File Name, place here the name you want to give the compiled exe ( please do not use spaces, they will come back to bite you).

Once you have set you build modes, you can quickly switch to build modes by selecting the build from the drop down arrow by the green run arrow button.

If you want to build many choose. Run->Compile Many Modes  a box will appear with all your build modes, select the ones you want to build.

Hope I got it right.
Development Installation Lazarus 1.3, FPC 2.7.1,Windows 7/8 32/64, OSX, *nix

Test Environment Lazarus & FPC Trunk on Windows and OSX (Cocoa Mainly on OSX). Testing also Crosscompile windows to OSX.. 
Any posts made from 2015 will be based on Lazarus Trunk.

Grahame Grieve

  • Full Member
  • ***
  • Posts: 111
Re: Managing Multiple Targets
« Reply #2 on: October 02, 2020, 09:18:49 am »
Awesome - that was exactly what I was looking for, thanks


TinyPortal © 2005-2018