mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-17 04:31:04 -06:00
Ninja: add CMAKE_JOB_POOLS variable as default for JOBS_POOLS
This enables configuration of build parallelism with the Ninja generator by
passing arguments on the command line to CMake. For example,
cmake \
'-DCMAKE_JOB_POOLS:STRING=compile=5;link=2' \
-DCMAKE_JOB_POOL_COMPILE:STRING=compile \
-DCMAKE_JOB_POOL_LINK:STRING=link \
~/src/MyProject
This commit is contained in:
@@ -50,6 +50,7 @@ Variables that Provide Information
|
|||||||
/variable/CMAKE_IMPORT_LIBRARY_SUFFIX
|
/variable/CMAKE_IMPORT_LIBRARY_SUFFIX
|
||||||
/variable/CMAKE_JOB_POOL_COMPILE
|
/variable/CMAKE_JOB_POOL_COMPILE
|
||||||
/variable/CMAKE_JOB_POOL_LINK
|
/variable/CMAKE_JOB_POOL_LINK
|
||||||
|
/variable/CMAKE_JOB_POOLS
|
||||||
/variable/CMAKE_LANG_COMPILER_AR
|
/variable/CMAKE_LANG_COMPILER_AR
|
||||||
/variable/CMAKE_LANG_COMPILER_RANLIB
|
/variable/CMAKE_LANG_COMPILER_RANLIB
|
||||||
/variable/CMAKE_LINK_LIBRARY_SUFFIX
|
/variable/CMAKE_LINK_LIBRARY_SUFFIX
|
||||||
|
|||||||
@@ -19,5 +19,8 @@ Defined pools could be used globally by setting
|
|||||||
or per target by setting the target properties
|
or per target by setting the target properties
|
||||||
:prop_tgt:`JOB_POOL_COMPILE` and :prop_tgt:`JOB_POOL_LINK`.
|
:prop_tgt:`JOB_POOL_COMPILE` and :prop_tgt:`JOB_POOL_LINK`.
|
||||||
|
|
||||||
|
If not set, this property uses the value of the :variable:`CMAKE_JOB_POOLS`
|
||||||
|
variable.
|
||||||
|
|
||||||
Build targets provided by CMake that are meant for individual interactive
|
Build targets provided by CMake that are meant for individual interactive
|
||||||
use, such as ``install``, are placed in the ``console`` pool automatically.
|
use, such as ``install``, are placed in the ``console`` pool automatically.
|
||||||
|
|||||||
7
Help/release/dev/cmake-job-pool.rst
Normal file
7
Help/release/dev/cmake-job-pool.rst
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
cmake-job-pool
|
||||||
|
--------------
|
||||||
|
|
||||||
|
* A :variable:`CMAKE_JOB_POOLS` variable was added specify a value to use for
|
||||||
|
the :prop_gbl:`JOB_POOLS` property. This enables control over build
|
||||||
|
parallelism with command line configuration parameters when using the Ninja
|
||||||
|
generator.
|
||||||
6
Help/variable/CMAKE_JOB_POOLS.rst
Normal file
6
Help/variable/CMAKE_JOB_POOLS.rst
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
CMAKE_JOB_POOLS
|
||||||
|
---------------
|
||||||
|
|
||||||
|
If the :prop_gbl:`JOB_POOLS` global property is not set, the value
|
||||||
|
of this variable is used in its place. See :prop_gbl:`JOB_POOLS`
|
||||||
|
for additional information.
|
||||||
@@ -207,6 +207,9 @@ void cmLocalNinjaGenerator::WritePools(std::ostream& os)
|
|||||||
|
|
||||||
const char* jobpools =
|
const char* jobpools =
|
||||||
this->GetCMakeInstance()->GetState()->GetGlobalProperty("JOB_POOLS");
|
this->GetCMakeInstance()->GetState()->GetGlobalProperty("JOB_POOLS");
|
||||||
|
if (!jobpools) {
|
||||||
|
jobpools = this->GetMakefile()->GetDefinition("CMAKE_JOB_POOLS");
|
||||||
|
}
|
||||||
if (jobpools) {
|
if (jobpools) {
|
||||||
cmGlobalNinjaGenerator::WriteComment(
|
cmGlobalNinjaGenerator::WriteComment(
|
||||||
os, "Pools defined by global property JOB_POOLS");
|
os, "Pools defined by global property JOB_POOLS");
|
||||||
|
|||||||
Reference in New Issue
Block a user