Skip to content

Remove cmake code for unity builds

Heiko Becker requested to merge work/remove-cmake-unity-code into release/21.04

It serves little purpose because it basically duplicates cmake's CMAKE_UNITY_BUILD switch and even causes confusion if they are both set to different values. If I pass -DCMAKE_UNITY_BUILD=FALSE to cmake >= 3.16.0 for example, I wouldn't expect a unity build but that's what I would get. Furthermore some parts are even discouraged by the official cmake documentation. It states "Projects should not directly set the UNITY_BUILD property or its associated CMAKE_UNITY_BUILD variable to true" [1]. However, the documentation recommends to set the UNITY_BUILD to FALSE for targets known to cause problems with unity builds. cmake < 3.16.0 seems to just ignore that (tested with 3.15.7), so no need for a version check.

[1] https://cmake.org/cmake/help/latest/prop_tgt/UNITY_BUILD.html

Merge request reports

Loading