diff options
author | Aaron Carlisle <carlisle.b3d@gmail.com> | 2022-01-12 00:55:18 +0300 |
---|---|---|
committer | Aaron Carlisle <carlisle.b3d@gmail.com> | 2022-01-12 00:55:45 +0300 |
commit | 5a6ec0f0035b6bb8a75b18826f4d0f687ec5ec21 (patch) | |
tree | 70f22be347a5324c6176d3362a583bbe397a6dda /source/blender/compositor | |
parent | 48ff9b57f8a53828b30ddbed94df89564b012b44 (diff) |
Build: Enable unity build for `bf_compositor`
Blender's compositor code already makes extensive use of
namespace which makes it very simple to enable unity build.
There was one duplicated function that has since to be moved
to a common header.
I saw roughly a 3x speedup of bf_compositor using ninja on
linux using i5 8250u (1:34 down to 0:34).
Reviewed By: LazyDodo
Differential Revision: https://developer.blender.org/D13792
Diffstat (limited to 'source/blender/compositor')
-rw-r--r-- | source/blender/compositor/CMakeLists.txt | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/compositor/CMakeLists.txt b/source/blender/compositor/CMakeLists.txt index af8ba0a24a5..88ce9b88097 100644 --- a/source/blender/compositor/CMakeLists.txt +++ b/source/blender/compositor/CMakeLists.txt @@ -645,6 +645,11 @@ endif() blender_add_lib(bf_compositor "${SRC}" "${INC}" "${INC_SYS}" "${LIB}") +if(WITH_UNITY_BUILD) + set_target_properties(bf_compositor PROPERTIES UNITY_BUILD ON) + set_target_properties(bf_compositor PROPERTIES UNITY_BUILD_BATCH_SIZE 10) +endif() + if(COMMAND target_precompile_headers) target_precompile_headers(bf_compositor PRIVATE COM_precomp.h) endif() |