From a654e0dde391e44cedf77627469774007bb8810e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 14 Mar 2024 10:38:15 +1100 Subject: [PATCH] Cleanup: unset temporary variables in CMake --- build_files/cmake/macros.cmake | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake index 803c15a5b25..0b3b071c70d 100644 --- a/build_files/cmake/macros.cmake +++ b/build_files/cmake/macros.cmake @@ -473,6 +473,8 @@ endfunction() # Ninja only: assign 'heavy pool' to some targets that are especially RAM-consuming to build. function(setup_heavy_lib_pool) if(WITH_NINJA_POOL_JOBS AND NINJA_MAX_NUM_PARALLEL_COMPILE_HEAVY_JOBS) + set(_HEAVY_LIBS) + set(_TARGET) if(WITH_CYCLES) list(APPEND _HEAVY_LIBS "cycles_device" "cycles_kernel") endif() @@ -483,11 +485,13 @@ function(setup_heavy_lib_pool) list(APPEND _HEAVY_LIBS "bf_intern_openvdb") endif() - foreach(TARGET ${_HEAVY_LIBS}) - if(TARGET ${TARGET}) - set_property(TARGET ${TARGET} PROPERTY JOB_POOL_COMPILE compile_heavy_job_pool) + foreach(_TARGET ${_HEAVY_LIBS}) + if(TARGET ${_TARGET}) + set_property(TARGET ${_TARGET} PROPERTY JOB_POOL_COMPILE compile_heavy_job_pool) endif() endforeach() + unset(_TARGET) + unset(_HEAVY_LIBS) endif() endfunction()