diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2022-05-17 18:29:47 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2022-05-19 19:54:28 (GMT) |
commit | 13ab9fbf36165f707dd5e7dbeebc4e964fc8aefa (patch) | |
tree | bf97adb4c3d238f127cbb5c5a77137d54bd5f21a /Source/cmMakefileLibraryTargetGenerator.cxx | |
parent | f1d55ff7e9372236ccf3da54397ed549a177b95a (diff) | |
download | CMake-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.cxx | 4 |
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); } |