summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-10-22 17:57:54 (GMT)
committerBrad King <brad.king@kitware.com>2020-12-15 12:00:52 (GMT)
commit7b64b0cd5a4046bf8743c3e2d3c57cb470bfa95f (patch)
treee054475a078a46be0c4c76e01c83409db0034481 /Source/cmGeneratorTarget.cxx
parentd29da8ed3eb757d10643039aa738bad0727c1b6a (diff)
downloadCMake-7b64b0cd5a4046bf8743c3e2d3c57cb470bfa95f.zip
CMake-7b64b0cd5a4046bf8743c3e2d3c57cb470bfa95f.tar.gz
CMake-7b64b0cd5a4046bf8743c3e2d3c57cb470bfa95f.tar.bz2
cmLocalGenerator: Refactor custom command generator construction
Add support for constructing and using multiple generators for one custom command. cmGeneratorTarget contains a code path that needs this behavior when used with Ninja but not other generators, so use virtual dispatch through cmLocalGenerator.
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r--Source/cmGeneratorTarget.cxx15
1 files changed, 8 insertions, 7 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index b444edd..5293f52 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -3079,15 +3079,16 @@ void cmTargetTraceDependencies::CheckCustomCommand(cmCustomCommand const& cc)
std::set<std::string> depends;
for (std::string const& config :
this->Makefile->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig)) {
- cmCustomCommandGenerator ccg(cc, config, this->LocalGenerator);
+ for (cmCustomCommandGenerator const& ccg :
+ this->LocalGenerator->MakeCustomCommandGenerators(cc, config)) {
+ // Collect target-level dependencies referenced in command lines.
+ for (auto const& util : ccg.GetUtilities()) {
+ this->GeneratorTarget->Target->AddUtility(util);
+ }
- // Collect target-level dependencies referenced in command lines.
- for (auto const& util : ccg.GetUtilities()) {
- this->GeneratorTarget->Target->AddUtility(util);
+ // Collect file-level dependencies referenced in DEPENDS.
+ depends.insert(ccg.GetDepends().begin(), ccg.GetDepends().end());
}
-
- // Collect file-level dependencies referenced in DEPENDS.
- depends.insert(ccg.GetDepends().begin(), ccg.GetDepends().end());
}
// Queue file-level dependencies.