diff options
author | Jacques Lucke <jacques@blender.org> | 2021-11-24 13:40:26 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-11-24 13:40:26 +0300 |
commit | 050b205a97c4dc0b9819fd2eea1fbe78cc1981ec (patch) | |
tree | cfe1ae1efdb1974ef61b19fce62dc527dd0ef44d /source/blender/nodes | |
parent | 3850fdd5b957aa3b8f70d3c0b952b07af6b07fe1 (diff) |
CMake: add WITH_UNITY_BUILD option to improve compile times
Unity builds are only used in the `bf_nodes_geometry` module for now.
This module has been prepared to support unity builds already.
Usually, there is a 2-4x speedup when building `bf_nodes_geometry`
compared to without unity builds (e.g. 145s to 55s).
For more information about how unity builds work and how they help
with compile times, see D13341.
Differential Revision: https://developer.blender.org/D13341
Diffstat (limited to 'source/blender/nodes')
-rw-r--r-- | source/blender/nodes/geometry/CMakeLists.txt | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/nodes/geometry/CMakeLists.txt b/source/blender/nodes/geometry/CMakeLists.txt index 61b5bbf6e7e..576c5249e98 100644 --- a/source/blender/nodes/geometry/CMakeLists.txt +++ b/source/blender/nodes/geometry/CMakeLists.txt @@ -265,3 +265,8 @@ if(WITH_OPENVDB) endif() blender_add_lib(bf_nodes_geometry "${SRC}" "${INC}" "${INC_SYS}" "${LIB}") + +if(WITH_UNITY_BUILD) + set_target_properties(bf_nodes_geometry PROPERTIES UNITY_BUILD ON) + set_target_properties(bf_nodes_geometry PROPERTIES UNITY_BUILD_BATCH_SIZE 10) +endif() |