[Lazarus] Applying optimization to the project units

Mattias Gaertner nc-gaertnma at netcologne.de
Wed Nov 24 23:50:01 CET 2010


On Thu, 25 Nov 2010 00:44:52 +0300
Max Vlasov <max.vlasov at gmail.com> wrote:

> On Thu, Nov 25, 2010 at 12:36 AM, Mattias Gaertner <
> nc-gaertnma at netcologne.de> wrote:
> 
> > On Thu, 25 Nov 2010 00:03:09 +0300
> > Max Vlasov <max.vlasov at gmail.com> wrote:
> >
> > > Hi,
> > > sometimes it takes time for a Delphi developer to understand the logic of
> > > fpc/lazarus packages and it's indeed content and full. Recently tried to
> > > measure different performance related numbers for a project and finally
> > got
> > > that I should change the level of optimization for packages, not for the
> > > project if performance-related unit is in a package (CMIIW). But just
> > > wondering,.. these options actually consumes time so more often
> > developers
> > > leave optimization to fastest and when the time comes, rebuilds the
> > project
> > > with full optimization on. It looks like there's no single option
> > allowing
> > > do this for a given project in Lazarus, right? But even if there's an
> > option
> > > to rebuild all related packages, I still can't with one click change this
> > > radiobox for every related package. Probably this won't be a problem if I
> > > finally understand the logic and get used to it, just trying to find
> > whether
> > > I miss something
> >
> > You can add a macro (e.g. $(MyOptions) ) to the custom options of
> > a package and set the macro in the project build macros (e.g.
> > MyOptions=-O4). You need 0.9.29 for this.
> >
> >
> >
> >
> Mattias, it looks very promising, but will it affect the logic of "build
> all" command, currently from what I see from output it doesn't care about
> other packages units as long as their dates were not changed.

If the build options changed the package is recompiled.


> In other
> words, what is the menu item I should use to "force" fpc compile not only
> units with changed dates, but all units from all packages using and with my
> new  $(MyOptions)?

No force needed.

Mattias




More information about the Lazarus mailing list