Commit 42494056 authored by Ben Boeckel's avatar Ben Boeckel

cmake: put static executable links into a -j1 pool

Buildbots which do static builds (BUILD_SHARED_LIBS=OFF) are running out
of memory (or hitting swap) while linking all of the static libraries
into the resulting executables in ParaView because they link
"everything" and all occur at the same time as a result of having the
same dependency trees.

Instead, place these links into a pool which only allows a single build
rule to happen at a time. Only applicable for Ninja at the moment.
parent efe089a7
......@@ -424,6 +424,9 @@ function(pv_add_executable name)
add_executable(${name} ${ARGN})
set_property(GLOBAL APPEND PROPERTY VTK_TARGETS ${name})
endif()
if (PV_EXE_JOB_LINK_POOL)
set_property(TARGET "${name}" PROPERTY JOB_POOL_LINK ${PV_EXE_JOB_LINK_POOL})
endif ()
pv_executable_install(${name} "${VTK_EXE_SUFFIX}")
endfunction()
......
......@@ -61,6 +61,14 @@ endif()
option(BUILD_SHARED_LIBS "Build VTK with shared libraries." ON)
set(VTK_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
#------------------------------------------------------------------------------
# Protect against a stampede of static links at the same time.
if (NOT BUILD_SHARED_LIBS)
set(PV_EXE_JOB_LINK_POOL static_exe_link)
set_property(GLOBAL APPEND PROPERTY
JOB_POOLS static_exe_link=1)
endif ()
#-------------------------------------------------------------------------------
set (ParaView_CMAKE_DIR "${ParaView_SOURCE_DIR}/CMake")
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ParaView_CMAKE_DIR})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment