summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-09-04 13:53:34 -0400
committerBrad King <brad.king@kitware.com>2020-09-08 15:38:40 -0400
commit844779bdc1cf124974d946d7a221407dd4d3f693 (patch)
tree73f18d6389c713a1800174c8c1ad091fe7a7f471 /Source
parentb1b345c21a180fac2b9ccecf02f708d00f100590 (diff)
downloadcmake-844779bdc1cf124974d946d7a221407dd4d3f693.tar.gz
cmMakefileTargetGenerator: Simplify custom command output collection
Diffstat (limited to 'Source')
-rw-r--r--Source/cmMakefileTargetGenerator.cxx13
-rw-r--r--Source/cmMakefileTargetGenerator.h3
2 files changed, 6 insertions, 10 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index ebfddb934b..bc0725e8fc 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -1290,16 +1290,7 @@ void cmMakefileTargetGenerator::DriveCustomCommands(
std::vector<std::string>& depends)
{
// Depend on all custom command outputs.
- std::vector<cmSourceFile*> sources;
- this->GeneratorTarget->GetSourceFiles(
- sources, this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"));
- for (cmSourceFile* source : sources) {
- if (cmCustomCommand* cc = source->GetCustomCommand()) {
- cmCustomCommandGenerator ccg(*cc, this->GetConfigName(),
- this->LocalGenerator);
- cm::append(depends, ccg.GetOutputs());
- }
- }
+ cm::append(depends, this->CustomCommandOutputs);
}
void cmMakefileTargetGenerator::WriteObjectDependRules(
@@ -1360,6 +1351,8 @@ void cmMakefileTargetGenerator::GenerateCustomRuleFile(
this->LocalGenerator->AddImplicitDepends(this->GeneratorTarget, idi.first,
objFullPath, srcFullPath);
}
+
+ this->CustomCommandOutputs.insert(outputs.begin(), outputs.end());
}
void cmMakefileTargetGenerator::MakeEchoProgress(
diff --git a/Source/cmMakefileTargetGenerator.h b/Source/cmMakefileTargetGenerator.h
index fd6dac8bc6..b7ec442805 100644
--- a/Source/cmMakefileTargetGenerator.h
+++ b/Source/cmMakefileTargetGenerator.h
@@ -228,6 +228,9 @@ protected:
// Set of extra output files to be driven by the build.
std::set<std::string> ExtraFiles;
+ // Set of custom command output files to be driven by the build.
+ std::set<std::string> CustomCommandOutputs;
+
using MultipleOutputPairsType = std::map<std::string, std::string>;
MultipleOutputPairsType MultipleOutputPairs;
bool WriteMakeRule(std::ostream& os, const char* comment,