mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-08 05:27:14 +09:00
Meta: Add a link job pool with a configurable size
Parallel linking (esp. with bfd) uses a huge chunk of memory, make it possible for users to limit the number of link jobs to at least limit the pain.
This commit is contained in:
parent
ccf03316fa
commit
fac2ee4452
Notes:
github-actions[bot]
2025-04-08 12:02:44 +00:00
Author: https://github.com/alimpfard
Commit: fac2ee4452
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4256
Reviewed-by: https://github.com/R-Goc
3 changed files with 17 additions and 0 deletions
|
@ -279,6 +279,17 @@ cmake --build --preset default MyBuildDir
|
|||
ninja -C MyBuildDir run-ladybird
|
||||
```
|
||||
|
||||
### Building with limited system memory
|
||||
|
||||
The default build mode will run as many build steps in parallel as possible, which includes link steps;
|
||||
this may be an issue for users with limited system memory (or users building with fat LTO in general).
|
||||
If you wish to reduce the number of parallel link jobs, you may use the LAGOM_LINK_POOL_SIZE cmake option
|
||||
to set a maximum limit for the number of parallel link jobs.
|
||||
|
||||
```
|
||||
cmake --preset default -B MyBuildDir -DLAGOM_LINK_POOL_SIZE=2
|
||||
```
|
||||
|
||||
### Running manually
|
||||
|
||||
The Meta/ladybird.sh script will execute the `run-ladybird` and `debug-ladybird` custom targets.
|
||||
|
|
|
@ -13,6 +13,7 @@ serenity_option(ENABLE_FUZZERS_OSSFUZZ OFF CACHE BOOL "Build OSS-Fuzz compatible
|
|||
serenity_option(LAGOM_TOOLS_ONLY OFF CACHE BOOL "Don't build libraries, utilities and tests, only host build tools")
|
||||
serenity_option(ENABLE_LAGOM_CCACHE ON CACHE BOOL "Enable ccache for Lagom builds")
|
||||
serenity_option(LAGOM_USE_LINKER "" CACHE STRING "The linker to use (e.g. lld, mold) instead of the system default")
|
||||
serenity_option(LAGOM_LINK_POOL_SIZE "" CACHE STRING "The maximum number of parallel jobs to use for linking")
|
||||
serenity_option(ENABLE_LAGOM_COVERAGE_COLLECTION OFF CACHE STRING "Enable code coverage instrumentation for lagom binaries in clang")
|
||||
|
||||
if (ANDROID OR APPLE)
|
||||
|
|
|
@ -30,3 +30,8 @@ if (LAGOM_USE_LINKER)
|
|||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${LINKER_FLAG}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (LAGOM_LINK_POOL_SIZE)
|
||||
set_property(GLOBAL PROPERTY JOB_POOLS link_pool=${LAGOM_LINK_POOL_SIZE})
|
||||
set(CMAKE_JOB_POOL_LINK link_pool CACHE STRING "Linking job pool")
|
||||
endif()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue