mirror of
https://github.com/reactos/CMake.git
synced 2024-11-27 05:20:34 +00:00
Ninja: Add a separate job pool for PCH creation
Add a `JOB_POOL_PRECOMPILE_HEADER` target property to specify the pool name, and its associated `CMAKE_JOB_POOL_PRECOMPILE_HEADER` variable. Fixes: #20217
This commit is contained in:
parent
ebd0b16ddb
commit
97c124e30f
@ -221,6 +221,7 @@ syn keyword cmakeProperty contained
|
|||||||
\ JOB_POOLS
|
\ JOB_POOLS
|
||||||
\ JOB_POOL_COMPILE
|
\ JOB_POOL_COMPILE
|
||||||
\ JOB_POOL_LINK
|
\ JOB_POOL_LINK
|
||||||
|
\ JOB_POOL_PRECOMPILE_HEADER
|
||||||
\ KEEP_EXTENSION
|
\ KEEP_EXTENSION
|
||||||
\ LABELS
|
\ LABELS
|
||||||
\ LANGUAGE
|
\ LANGUAGE
|
||||||
@ -1066,6 +1067,7 @@ syn keyword cmakeVariable contained
|
|||||||
\ CMAKE_JOB_POOLS
|
\ CMAKE_JOB_POOLS
|
||||||
\ CMAKE_JOB_POOL_COMPILE
|
\ CMAKE_JOB_POOL_COMPILE
|
||||||
\ CMAKE_JOB_POOL_LINK
|
\ CMAKE_JOB_POOL_LINK
|
||||||
|
\ CMAKE_JOB_POOL_PRECOMPILE_HEADER
|
||||||
\ CMAKE_Java
|
\ CMAKE_Java
|
||||||
\ CMAKE_Java_ANDROID_TOOLCHAIN_MACHINE
|
\ CMAKE_Java_ANDROID_TOOLCHAIN_MACHINE
|
||||||
\ CMAKE_Java_ANDROID_TOOLCHAIN_PREFIX
|
\ CMAKE_Java_ANDROID_TOOLCHAIN_PREFIX
|
||||||
|
@ -253,6 +253,7 @@ Properties on Targets
|
|||||||
/prop_tgt/IOS_INSTALL_COMBINED
|
/prop_tgt/IOS_INSTALL_COMBINED
|
||||||
/prop_tgt/JOB_POOL_COMPILE
|
/prop_tgt/JOB_POOL_COMPILE
|
||||||
/prop_tgt/JOB_POOL_LINK
|
/prop_tgt/JOB_POOL_LINK
|
||||||
|
/prop_tgt/JOB_POOL_PRECOMPILE_HEADER
|
||||||
/prop_tgt/LABELS
|
/prop_tgt/LABELS
|
||||||
/prop_tgt/LANG_CLANG_TIDY
|
/prop_tgt/LANG_CLANG_TIDY
|
||||||
/prop_tgt/LANG_COMPILER_LAUNCHER
|
/prop_tgt/LANG_COMPILER_LAUNCHER
|
||||||
|
@ -65,6 +65,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_POOL_PRECOMPILE_HEADER
|
||||||
/variable/CMAKE_JOB_POOLS
|
/variable/CMAKE_JOB_POOLS
|
||||||
/variable/CMAKE_LANG_COMPILER_AR
|
/variable/CMAKE_LANG_COMPILER_AR
|
||||||
/variable/CMAKE_LANG_COMPILER_RANLIB
|
/variable/CMAKE_LANG_COMPILER_RANLIB
|
||||||
|
21
Help/prop_tgt/JOB_POOL_PRECOMPILE_HEADER.rst
Normal file
21
Help/prop_tgt/JOB_POOL_PRECOMPILE_HEADER.rst
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
JOB_POOL_PRECOMPILE_HEADER
|
||||||
|
--------------------------
|
||||||
|
|
||||||
|
Ninja only: Pool used for generating pre-compiled headers.
|
||||||
|
|
||||||
|
The number of parallel compile processes could be limited by defining
|
||||||
|
pools with the global :prop_gbl:`JOB_POOLS`
|
||||||
|
property and then specifying here the pool name.
|
||||||
|
|
||||||
|
For instance:
|
||||||
|
|
||||||
|
.. code-block:: cmake
|
||||||
|
|
||||||
|
set_property(TARGET myexe PROPERTY JOB_POOL_PRECOMPILE_HEADER two_jobs)
|
||||||
|
|
||||||
|
This property is initialized by the value of
|
||||||
|
:variable:`CMAKE_JOB_POOL_PRECOMPILE_HEADER`.
|
||||||
|
|
||||||
|
If neither :prop_tgt:`JOB_POOL_PRECOMPILE_HEADER` nor
|
||||||
|
:variable:`CMAKE_JOB_POOL_PRECOMPILE_HEADER` are set then
|
||||||
|
:prop_tgt:`JOB_POOL_COMPILE` will be used for this task.
|
6
Help/variable/CMAKE_JOB_POOL_PRECOMPILE_HEADER.rst
Normal file
6
Help/variable/CMAKE_JOB_POOL_PRECOMPILE_HEADER.rst
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
CMAKE_JOB_POOL_PRECOMPILE_HEADER
|
||||||
|
--------------------------------
|
||||||
|
|
||||||
|
This variable is used to initialize the :prop_tgt:`JOB_POOL_PRECOMPILE_HEADER`
|
||||||
|
property on all the targets. See :prop_tgt:`JOB_POOL_PRECOMPILE_HEADER`
|
||||||
|
for additional information.
|
@ -9,9 +9,10 @@ endif()
|
|||||||
set(__WINDOWS_COMPILER_PGI 1)
|
set(__WINDOWS_COMPILER_PGI 1)
|
||||||
|
|
||||||
# PGI on Windows doesn't support parallel compile processes
|
# PGI on Windows doesn't support parallel compile processes
|
||||||
if(NOT DEFINED CMAKE_JOB_POOL_LINK OR NOT DEFINED CMAKE_JOB_POOL_COMPILE)
|
if(NOT DEFINED CMAKE_JOB_POOL_LINK OR NOT DEFINED CMAKE_JOB_POOL_COMPILE OR NOT DEFINED CMAKE_JOB_POOL_PRECOMPILE_HEADER)
|
||||||
set(CMAKE_JOB_POOL_LINK PGITaskPool)
|
set(CMAKE_JOB_POOL_LINK PGITaskPool)
|
||||||
set(CMAKE_JOB_POOL_COMPILE PGITaskPool)
|
set(CMAKE_JOB_POOL_COMPILE PGITaskPool)
|
||||||
|
set(CMAKE_JOB_POOL_PRECOMPILE_HEADER PGITaskPool)
|
||||||
get_property(_pgijp GLOBAL PROPERTY JOB_POOLS)
|
get_property(_pgijp GLOBAL PROPERTY JOB_POOLS)
|
||||||
if(NOT _pgijp MATCHES "PGITaskPool=")
|
if(NOT _pgijp MATCHES "PGITaskPool=")
|
||||||
set_property(GLOBAL APPEND PROPERTY JOB_POOLS PGITaskPool=1)
|
set_property(GLOBAL APPEND PROPERTY JOB_POOLS PGITaskPool=1)
|
||||||
|
@ -1196,6 +1196,13 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
|
|||||||
this->addPoolNinjaVariable("JOB_POOL_COMPILE", this->GetGeneratorTarget(),
|
this->addPoolNinjaVariable("JOB_POOL_COMPILE", this->GetGeneratorTarget(),
|
||||||
vars);
|
vars);
|
||||||
|
|
||||||
|
if (!pchSource.empty() && !source->GetProperty("SKIP_PRECOMPILE_HEADERS")) {
|
||||||
|
if (source->GetFullPath() == pchSource) {
|
||||||
|
this->addPoolNinjaVariable("JOB_POOL_PRECOMPILE_HEADER",
|
||||||
|
this->GetGeneratorTarget(), vars);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this->SetMsvcTargetPdbVariable(vars, config);
|
this->SetMsvcTargetPdbVariable(vars, config);
|
||||||
|
|
||||||
objBuild.RspFile = objectFileName + ".rsp";
|
objBuild.RspFile = objectFileName + ".rsp";
|
||||||
|
@ -513,6 +513,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
|
|||||||
this->GetType() != cmStateEnums::UTILITY) {
|
this->GetType() != cmStateEnums::UTILITY) {
|
||||||
initProp("JOB_POOL_COMPILE");
|
initProp("JOB_POOL_COMPILE");
|
||||||
initProp("JOB_POOL_LINK");
|
initProp("JOB_POOL_LINK");
|
||||||
|
initProp("JOB_POOL_PRECOMPILE_HEADER");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (impl->TargetType <= cmStateEnums::UTILITY) {
|
if (impl->TargetType <= cmStateEnums::UTILITY) {
|
||||||
|
Loading…
Reference in New Issue
Block a user