Cleanup: unset temporary variables in CMake

This commit is contained in:
Campbell Barton
2024-03-14 10:38:15 +11:00
parent 7852e0a551
commit a654e0dde3

View File

@@ -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()