Skip to content

Commit

Permalink
[CMake][Ninja] Allow configuration of link/compile pool sizes
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=249221

Reviewed by NOBODY (OOPS\!).

* Source/cmake/WebKitCommon.cmake: Check environment for new
  variables to set the default link pool size (otherwise
  configure as before), also check for compile pool size
  and if present set up a pool for compile tasks.

Canonical link: https://commits.webkit.org/257800@main
  • Loading branch information
foopoiuyt committed Dec 13, 2022
1 parent 9420329 commit 3b7306b
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions Source/cmake/WebKitCommon.cmake
Expand Up @@ -235,14 +235,21 @@ if (NOT HAS_RUN_WEBKIT_COMMON)
endif ()

# -----------------------------------------------------------------------------
# Job pool to avoid running too many memory hungry linker processes
# Job pool to avoid running too many memory hungry processes
# -----------------------------------------------------------------------------
if (${CMAKE_BUILD_TYPE} STREQUAL "Release" OR ${CMAKE_BUILD_TYPE} STREQUAL "MinSizeRel")
set_property(GLOBAL PROPERTY JOB_POOLS link_pool_jobs=4)
if (DEFINED ENV{WEBKIT_NINJA_LINK_MAX})
list(APPEND WK_POOLS "link_pool_jobs=$ENV{WEBKIT_NINJA_LINK_MAX}")
elseif (${CMAKE_BUILD_TYPE} STREQUAL "Release" OR ${CMAKE_BUILD_TYPE} STREQUAL "MinSizeRel")
list(APPEND WK_POOLS link_pool_jobs=4)
else ()
set_property(GLOBAL PROPERTY JOB_POOLS link_pool_jobs=2)
list(APPEND WK_POOLS link_pool_jobs=2)
endif ()
set(CMAKE_JOB_POOL_LINK link_pool_jobs)
if (DEFINED ENV{WEBKIT_NINJA_COMPILE_MAX})
list(APPEND WK_POOLS "compile_pool_jobs=$ENV{WEBKIT_NINJA_COMPILE_MAX}")
set(CMAKE_JOB_POOL_COMPILE compile_pool_jobs)
endif ()
set_property(GLOBAL PROPERTY JOB_POOLS ${WK_POOLS})

# -----------------------------------------------------------------------------
# Create derived sources directories
Expand Down

0 comments on commit 3b7306b

Please sign in to comment.