mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-18 13:10:17 -06:00
Makefile: Add build events byproducts to clean rules
This commit is contained in:
@@ -189,6 +189,30 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add byproducts from build events to the clean rules
|
||||
if (clean) {
|
||||
std::vector<cmCustomCommand> buildEventCommands =
|
||||
this->GeneratorTarget->GetPreBuildCommands();
|
||||
|
||||
buildEventCommands.insert(
|
||||
buildEventCommands.end(),
|
||||
this->GeneratorTarget->GetPreLinkCommands().begin(),
|
||||
this->GeneratorTarget->GetPreLinkCommands().end());
|
||||
buildEventCommands.insert(
|
||||
buildEventCommands.end(),
|
||||
this->GeneratorTarget->GetPostBuildCommands().begin(),
|
||||
this->GeneratorTarget->GetPostBuildCommands().end());
|
||||
|
||||
for (const auto& be : buildEventCommands) {
|
||||
const std::vector<std::string>& byproducts = be.GetByproducts();
|
||||
for (std::string const& byproduct : byproducts) {
|
||||
this->CleanFiles.push_back(
|
||||
this->LocalGenerator->MaybeConvertToRelativePath(currentBinDir,
|
||||
byproduct));
|
||||
}
|
||||
}
|
||||
}
|
||||
std::vector<cmSourceFile const*> headerSources;
|
||||
this->GeneratorTarget->GetHeaderSources(headerSources, config);
|
||||
this->OSXBundleGenerator->GenerateMacOSXContentStatements(
|
||||
|
||||
Reference in New Issue
Block a user