diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2019-05-13 10:54:45 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2019-05-14 15:50:13 (GMT) |
commit | 7c8c18b1e61ca717941214c2365ce5c5056bad14 (patch) | |
tree | f78b3d9e5936d5af851dbdd32647b68e25fad468 /Source/cmMakefileExecutableTargetGenerator.cxx | |
parent | 1f0a695561f12b8e3929066d7dc61535a20af66c (diff) | |
download | CMake-7c8c18b1e61ca717941214c2365ce5c5056bad14.zip CMake-7c8c18b1e61ca717941214c2365ce5c5056bad14.tar.gz CMake-7c8c18b1e61ca717941214c2365ce5c5056bad14.tar.bz2 |
Makefiles: Sort clean files by using a std::set<std::string> container
By using a `std::set<std::string>` container instead of a
`std::vector<std::string>` container, the clean files list becomes sorted and
unique. The clean target in Makefiles beomes nicer and better readable this
way. Also double clean entries won't appear anymore.
Diffstat (limited to 'Source/cmMakefileExecutableTargetGenerator.cxx')
-rw-r--r-- | Source/cmMakefileExecutableTargetGenerator.cxx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx index ebf5fc2..beabf91 100644 --- a/Source/cmMakefileExecutableTargetGenerator.cxx +++ b/Source/cmMakefileExecutableTargetGenerator.cxx @@ -4,6 +4,7 @@ #include <algorithm> #include <memory> // IWYU pragma: keep +#include <set> #include <sstream> #include <string> #include <utility> @@ -291,8 +292,7 @@ void cmMakefileExecutableTargetGenerator::WriteDeviceExecutableRule( this->WriteTargetDriverRule(targetOutputReal, relink); // Clean all the possible executable names and symlinks. - this->CleanFiles.insert(this->CleanFiles.end(), exeCleanFiles.begin(), - exeCleanFiles.end()); + this->CleanFiles.insert(exeCleanFiles.begin(), exeCleanFiles.end()); #else static_cast<void>(relink); #endif @@ -480,7 +480,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink) // List the PDB for cleaning only when the whole target is // cleaned. We do not want to delete the .pdb file just before // linking the target. - this->CleanFiles.push_back(this->LocalGenerator->MaybeConvertToRelativePath( + this->CleanFiles.insert(this->LocalGenerator->MaybeConvertToRelativePath( this->LocalGenerator->GetCurrentBinaryDirectory(), targetFullPathPDB)); // Add the pre-build and pre-link rules building but not when relinking. @@ -695,6 +695,5 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink) this->WriteTargetDriverRule(targetFullPath, relink); // Clean all the possible executable names and symlinks. - this->CleanFiles.insert(this->CleanFiles.end(), exeCleanFiles.begin(), - exeCleanFiles.end()); + this->CleanFiles.insert(exeCleanFiles.begin(), exeCleanFiles.end()); } |