summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorDan Johnston <dan.e.johnston@gmail.com>2020-01-14 18:17:15 (GMT)
committerBrad King <brad.king@kitware.com>2020-01-16 15:32:25 (GMT)
commit97c124e30f530f64fafdc2b3a9decd1bf31bcf9c (patch)
treefa51db1fb364e307b3a46ff08a9c3ed4feece622 /Source
parentebd0b16ddbfc64d627aae7acb991aefa7179fa8b (diff)
downloadCMake-97c124e30f530f64fafdc2b3a9decd1bf31bcf9c.zip
CMake-97c124e30f530f64fafdc2b3a9decd1bf31bcf9c.tar.gz
CMake-97c124e30f530f64fafdc2b3a9decd1bf31bcf9c.tar.bz2
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
Diffstat (limited to 'Source')
-rw-r--r--Source/cmNinjaTargetGenerator.cxx7
-rw-r--r--Source/cmTarget.cxx1
2 files changed, 8 insertions, 0 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index bd19b28..5a8c144 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -1196,6 +1196,13 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
this->addPoolNinjaVariable("JOB_POOL_COMPILE", this->GetGeneratorTarget(),
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);
objBuild.RspFile = objectFileName + ".rsp";
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 9563321..64ac3fa 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -513,6 +513,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
this->GetType() != cmStateEnums::UTILITY) {
initProp("JOB_POOL_COMPILE");
initProp("JOB_POOL_LINK");
+ initProp("JOB_POOL_PRECOMPILE_HEADER");
}
if (impl->TargetType <= cmStateEnums::UTILITY) {