Hi, thanks a lot for adding support for FASTBuild!
I’m experimenting with enabling it in a large CMake-based project, and I noticed several quirks:
-
Is there any technical reason to use
UnityInputIsolatedFilesinstead ofUnityInputExcludedFilesfor source files with enabledSKIP_UNITY_BUILD_INCLUSION?
Isolated files prevent caching, which is undesirable when a fairly large number of files are skipped from Unity. CanUnityInputExcludedFilesbe used instead?
https://github.com/fastbuild/fastbuild/issues/1184 -
It seems that the FASTBuild generator doesn’t respect this rule: “Any source file that has a non-empty
COMPILE_OPTIONS,COMPILE_DEFINITIONS,COMPILE_FLAGS, orINCLUDE_DIRECTORIESsource property will not be combined into a unity source.”
We disable warnings in some of our code-generated files (QML) by usingCOMPILE_OPTIONSand do not add them toSKIP_UNITY_BUILD_INCLUSIONexplicitly. These source files compile individually with the Ninja generator, but with FASTBuild they are placed into Unity batches. -
It seems that the batching algorithm was changed between versions 4.2 (splitting source files by batch size and folder boundaries) and 4.3 (splitting source files only by batch size). This change is probably deliberate because version 4.3 follows
UNITY_BUILD_BATCH_SIZEmore closely and matches the batching behavior of other generators. However, in our project, version 4.2 is surprisingly much more performant (20–30% faster).
Can you consider making it configurable and allowing users to select the 4.2 batching behavior in future versions?