summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaTargetGenerator.cxx
diff options
context:
space:
mode:
authorCristian Adam <cristian.adam@gmail.com>2020-05-19 21:39:38 (GMT)
committerCristian Adam <cristian.adam@gmail.com>2020-05-20 09:20:38 (GMT)
commitf6cb1e646ca108125c33419e0829c152effaee47 (patch)
tree80f043f982539f61cbb9439770d9425c11840e79 /Source/cmNinjaTargetGenerator.cxx
parent2f3a356ea8dd8305ce4360c1652e2e5abfa9f1cf (diff)
downloadCMake-f6cb1e646ca108125c33419e0829c152effaee47.zip
CMake-f6cb1e646ca108125c33419e0829c152effaee47.tar.gz
CMake-f6cb1e646ca108125c33419e0829c152effaee47.tar.bz2
Multi-Ninja: Fix PCHs for Visual C++
Fixes: #20711
Diffstat (limited to 'Source/cmNinjaTargetGenerator.cxx')
-rw-r--r--Source/cmNinjaTargetGenerator.cxx21
1 files changed, 13 insertions, 8 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index efd2fd5..f4ff51b 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -1266,14 +1266,19 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
}
if (cmProp objectOutputs = source->GetProperty("OBJECT_OUTPUTS")) {
- cmNinjaBuild build("phony");
- build.Comment = "Additional output files.";
- build.Outputs = cmExpandedList(*objectOutputs);
- std::transform(build.Outputs.begin(), build.Outputs.end(),
- build.Outputs.begin(), MapToNinjaPath());
- build.ExplicitDeps = objBuild.Outputs;
- this->GetGlobalGenerator()->WriteBuild(this->GetImplFileStream(fileConfig),
- build);
+ std::string evaluatedObjectOutputs = cmGeneratorExpression::Evaluate(
+ *objectOutputs, this->LocalGenerator, config);
+
+ if (!evaluatedObjectOutputs.empty()) {
+ cmNinjaBuild build("phony");
+ build.Comment = "Additional output files.";
+ build.Outputs = cmExpandedList(evaluatedObjectOutputs);
+ std::transform(build.Outputs.begin(), build.Outputs.end(),
+ build.Outputs.begin(), MapToNinjaPath());
+ build.ExplicitDeps = objBuild.Outputs;
+ this->GetGlobalGenerator()->WriteBuild(
+ this->GetImplFileStream(fileConfig), build);
+ }
}
}