[Qt-creator] Compiling Qt Creator in under 3 minutes

Milian Wolff mail at milianw.de
Thu May 22 10:12:46 CEST 2014

On Thursday 22 May 2014 09:50:47 Christian Kandeler wrote:
> On 05/21/2014 09:28 PM, Jussi Pakkanen wrote:
> > On Wed, May 21, 2014 at 10:10 PM, André Pönitz <apoenitz at t-online.de
> > 
> > <mailto:apoenitz at t-online.de>> wrote:
> >     I am not sure I understood what the unity build does. Closest I can
> >     imagine
> >     is that it concatenates some (or all?) translation units into one
> >     and tries
> >     to compile the result. Of course that would not work with normal C++
> >     projects
> >     but would impose rather harsh restriction on naming conventions and
> >     code
> >     structure, so this can't be what is meant as this interpretation
> >     conflicts
> >     with the "in theory unity builds should not require any code changes".
> > 
> > There is a more involved explanation in Meson wiki:
> > 
> > https://sourceforge.net/p/meson/wiki/Unity%20builds/
> "There may also be some bugs in the source that need to be fixed before
> Unity compiles work. As an example, if both src1.c and src2.c contain a
> static function or variable of the same name, there will be a clash."
> How on earth is that a bug? That's a perfectly legal and normal thing to
> do, as the concept of translation units is well-defined. By merging them
> all together, one can probably even introduce subtle semantic changes
> (though admittedly that's just a gut feeling, I don't have a concrete
> example).
> What is the use case anyway? I guess it can only be an area where
> incremental builds are irrelevant. CI?

This. In KDE we used to have a CMake switch to "ENABLE_FINAL" builds, which is 
as far as I can see exactly the same as this unity stuff. It was highly 
annoying how often people complained about "broken compiles" just b/c a 
function name was used twice and stuff like that.

It's really not worth it, imo. Incremental builds will be far faster most of 
the time, I bet. And with lto, the performance difference for optimized builds 
should also be negligible to non-existent.

Milian Wolff
mail at milianw.de

More information about the Qt-creator mailing list