summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileLibraryTargetGenerator.cxx
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2022-05-17 18:29:47 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2022-05-19 19:54:28 (GMT)
commit13ab9fbf36165f707dd5e7dbeebc4e964fc8aefa (patch)
treebf97adb4c3d238f127cbb5c5a77137d54bd5f21a /Source/cmMakefileLibraryTargetGenerator.cxx
parentf1d55ff7e9372236ccf3da54397ed549a177b95a (diff)
downloadCMake-13ab9fbf36165f707dd5e7dbeebc4e964fc8aefa.zip
CMake-13ab9fbf36165f707dd5e7dbeebc4e964fc8aefa.tar.gz
CMake-13ab9fbf36165f707dd5e7dbeebc4e964fc8aefa.tar.bz2
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.
Diffstat (limited to 'Source/cmMakefileLibraryTargetGenerator.cxx')
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index 66031db..21b91e0 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -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);
}