Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[cmake] Option to create Ninja job pools depending on available resou…
…rces (llvm#65274) This PR adds options to let CMake calculate the ninja job pools depending on free memory and available cores. You can provide memory requirements for each compile and link job which is checked against CMake AVAILABLE_PHYSICAL_MEMORY and NUMBER_OF_LOGICAL_CORES. [This information are available since CMake 3.0](https://cmake.org/cmake/help/v3.0/command/cmake_host_system_information.html). This is very helpful in CI environments with multiple jobs per environment or a VM with multiple users. Its different to LLVM_PARALLEL_LINK_JOBS / LLVM_PARALLEL_COMPILE_JOBS (or ninja -j 1) because it tries to use the resources more efficient without being terminated. Only downside currently is that compile and link jobs can run at the same time so there is an offset for link job memory suggested which is added to the documentation. The definitions aren't added as cache because if I understand it correctly this would break it because values could be outdated.
- Loading branch information