# Unity/Amalgamation mode builds - best practices, when to use

**URL:** <https://forums.unrealengine.com/t/unity-amalgamation-mode-builds-best-practices-when-to-use/538098>\
**Category:** Platform & Builds\
**Tags:** Builds, unreal-engine, UE5-0, UE4, question\
**Created:** [April 24, 2022, 5:31am UTC](https://forums.unrealengine.com/t/unity-amalgamation-mode-builds-best-practices-when-to-use/538098 "2022-04-24T05:31:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mannyhams](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mannyhams/32/479588_2.png) [@mannyhams](https://forums.unrealengine.com/u/mannyhams)\
**Post date:** [April 24, 2022, 5:31am UTC](https://forums.unrealengine.com/t/unity-amalgamation-mode-builds-best-practices-when-to-use/538098/1 "2022-04-24T05:31:14Z")

</div>

Anyone have a good resource for learning more about the unity build system? Specifically best practices, tradeoffs, and the like?

For me I think the priority would be determinism - I’d like to either always build in unity mode, or always in non-unity mode so there are no surprises when compiling in various build contexts. Unclear if this is a wise thing to do, since I don’t clearly understand what all the various build contexts are or what their needs and defaults WRT unity builds might be.

Currently, my project uses `PCHUsageMode.UseExplicitOrSharedPCHs` (like all new projects?) in all of its modules, but I haven’t touched any of the unity-build-related options in my .target.cs files. So what’s going on in my builds? Is it that they’re IWYU-ready, but still running in (adaptive) unity mode since `bUseAdaptiveUnityBuild` defaults to true?

Resources I’m aware of…

- [IWYU Docs](https://docs.unrealengine.com/4.27/en-US/ProductionPipelines/BuildTools/UnrealBuildTool/IWYU/)
- [how to compile in non unity mode](https://forums.unrealengine.com/t/how-to-compile-in-non-unity-mode/94863)
- [UBT config docs](https://docs.unrealengine.com/4.27/en-US/ProductionPipelines/BuildTools/UnrealBuildTool/BuildConfiguration/)

Thanks, I realize this is a lot!
