[Lazarus] Size of program executable very big...

Paul van Helden paul at planetgis.co.za
Sat Feb 19 11:01:30 CET 2011


> > When I click Run, a lot of untouched units are recompiled every time...
> What
> > exactly is the difference between "Run", "Build", "Build all" and "Quick
> > compile"?
>
> Yes, sorry for the fuzz.
> Run checks if something changed and invokes a "Build". Then start
> program or debugger.
> Build calls compiler.
> Build all calls compiler with -B.
> Quick compile calls compiler with options to omit assembling and
> linking.
>
>
> > When I do a "build all", it takes 10 seconds for my project. Then I touch
> an
> > insignificant unit and most, but not all, units are recompiled. 6
> seconds.
>
> Maybe linking your program takes a few seconds.
>
>
I have found the cause! Some months ago I started outputting the .o and .ppu
files into a subdirectory. Ever since, for each unit that had an old .o and
.ppu in the main directory, Build would recompile it. This caused a
recompile of more than half of all my code every time I ran the project (if
there had been a change).

Now everything makes a lot more sense.

* Run will invoke Build if a change has been detected to the source. (Some
source file with a later date than ProjectName.compiled or ProjectName.exe?)
* Build recompiles all units with source files that are newer than their
object files (but looks in the main directory first for the object files)
and of course any other dependent units if needed. (When any compiler
switches were changed, Build All is invoked instead?).
* Build All recompiles all used units regardless.
* Quick compile does a Build without linking.

I'm sure the above summary could be improved upon.

Regards,

Paul.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20110219/54488e8e/attachment-0003.html>


More information about the Lazarus mailing list