diff options
author | Pedro Navarro <pnavarro@netflix.com> | 2018-08-30 22:34:24 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-09-28 15:30:32 (GMT) |
commit | 4220962d18f77399286270607eb135378b71c5b9 (patch) | |
tree | b16774771a4c55256dbdf0f47d81aeb2aba6b4cf /Source | |
parent | 182d9597ec7b28727dc8e878a90a9bedf6d33f51 (diff) | |
download | CMake-4220962d18f77399286270607eb135378b71c5b9.zip CMake-4220962d18f77399286270607eb135378b71c5b9.tar.gz CMake-4220962d18f77399286270607eb135378b71c5b9.tar.bz2 |
Makefile: Add build events byproducts to clean rules
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 65a69d1..f423560 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -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( |