mirror of
https://github.com/Kitware/CMake.git
synced 2026-08-07 16:20:51 +00:00
cmMakefileTargetGenerator: Simplify custom command output collection
This commit is contained in:
@@ -1290,16 +1290,7 @@ void cmMakefileTargetGenerator::DriveCustomCommands(
|
|||||||
std::vector<std::string>& depends)
|
std::vector<std::string>& depends)
|
||||||
{
|
{
|
||||||
// Depend on all custom command outputs.
|
// Depend on all custom command outputs.
|
||||||
std::vector<cmSourceFile*> sources;
|
cm::append(depends, this->CustomCommandOutputs);
|
||||||
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());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmMakefileTargetGenerator::WriteObjectDependRules(
|
void cmMakefileTargetGenerator::WriteObjectDependRules(
|
||||||
@@ -1360,6 +1351,8 @@ void cmMakefileTargetGenerator::GenerateCustomRuleFile(
|
|||||||
this->LocalGenerator->AddImplicitDepends(this->GeneratorTarget, idi.first,
|
this->LocalGenerator->AddImplicitDepends(this->GeneratorTarget, idi.first,
|
||||||
objFullPath, srcFullPath);
|
objFullPath, srcFullPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this->CustomCommandOutputs.insert(outputs.begin(), outputs.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmMakefileTargetGenerator::MakeEchoProgress(
|
void cmMakefileTargetGenerator::MakeEchoProgress(
|
||||||
|
|||||||
@@ -228,6 +228,9 @@ protected:
|
|||||||
// Set of extra output files to be driven by the build.
|
// Set of extra output files to be driven by the build.
|
||||||
std::set<std::string> ExtraFiles;
|
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>;
|
using MultipleOutputPairsType = std::map<std::string, std::string>;
|
||||||
MultipleOutputPairsType MultipleOutputPairs;
|
MultipleOutputPairsType MultipleOutputPairs;
|
||||||
bool WriteMakeRule(std::ostream& os, const char* comment,
|
bool WriteMakeRule(std::ostream& os, const char* comment,
|
||||||
|
|||||||
Reference in New Issue
Block a user