CMAKE_UNITY_BUILD

This variable is used to initialize the UNITY_BUILD property of targets when they are created. Setting it to true enables batch compilation of multiple sources within each target. This feature is known as a Unity or Jumbo build.

Projects should not set this variable, it is intended as a developer control to be set on the cmake(1) command line or other equivalent methods. The developer must have the ability to enable or disable unity builds according to the capabilities of their own machine and compiler.

By default, this variable is not set, which will result in unity builds being disabled.

Note

This option currently does not work well in combination with the CMAKE_EXPORT_COMPILE_COMMANDS variable.

© 2000–2020 Kitware, Inc. and Contributors
Licensed under the BSD 3-clause License.
https://cmake.org/cmake/help/v3.17/variable/CMAKE_UNITY_BUILD.html