Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

By unity build I think they mean all cpp files within a module are compiled included into one (so each cpp isn't a separate execution unit, anonymous namespace etc. will bleed over between files unless they are in separate unreal module or plugin).

Similar to SQLite amalgamation.

Turning it off could parralelize the build more, except linkers are often singlethreaded and bottleneck things enough to undo that benefit sometimes.



You really don't want to turn off unity builds in unreal for anything larger than a toy project. The build system is "smart" (albeit itself is slower than say ninja). It breaks the project up into multiple unity "blobs" for you, and they're compiled in parallel. It also integrates with source control to remove files from the "working set" so if you're iterating on a small file it will be removed from the unity blob and compiled on its own for faster iteration.


Running a unity build [1] means the compiler only has to parse and reason about the headers once. So you lose the parallelism of multiple TUs, but you gain on not doing the header crunching over and over again. Whether your codebase will benefit from that is a matter for testing, but many do.

[1]: https://en.wikipedia.org/wiki/Unity_build


also by using unity build you don't need to link object files. I think that is main reason to use unity build, it eliminates need for any build system and compiling source code in a new machine is as simple as compiling a single transition unit.


Unreal is far too big for one unity blob. It still requires a build system for many other reasons.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: