#include all .cpp files into a single compilation unit?

It’s referred to by some (and google-able) as a “Unity Build”. It links insanely fast and compiles reasonably quickly as well. It’s great for builds you don’t need to iterate on, like a release build from a central server, but it isn’t necessarily for incremental building.

And it’s a PITA to maintain.

EDIT: here’s the first google link for more info: http://buffered.io/posts/the-magic-of-unity-builds/

The thing that makes it fast is that the compiler only needs to read in everything once, compile out, then link, rather than doing that for every .cpp file.

Bruce Dawson has a much better write up about this on his blog: http://randomascii.wordpress.com/2014/03/22/make-vc-compiles-fast-through-parallel-compilation/

Leave a Comment