cmMakefileLibraryTargetGenerator: improve output building

GCC warns about buffer juggling here. To avoid the warning, improve the
code to avoid resizing on the following two pushes.
This commit is contained in:
Ben Boeckel
2022-05-17 14:29:47 -04:00
parent f1d55ff7e9
commit 13ab9fbf36

View File

@@ -929,7 +929,9 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
}
// Compute the list of outputs.
std::vector<std::string> outputs(1, targetFullPathReal);
std::vector<std::string> outputs;
outputs.reserve(3);
outputs.push_back(targetFullPathReal);
if (this->TargetNames.SharedObject != this->TargetNames.Real) {
outputs.push_back(targetFullPathSO);
}