summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2023-07-27 18:43:10 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2023-07-28 00:15:51 (GMT)
commitd4144b9c0a1a8a8f3a24ff33fc2582bb319d73ac (patch)
tree1fa5c411f938f8a5b9195f3b0b02ab60cc21dd11
parent809248a0c9f3c2c203399d4cefe10a23cfc53add (diff)
downloadCMake-d4144b9c0a1a8a8f3a24ff33fc2582bb319d73ac.zip
CMake-d4144b9c0a1a8a8f3a24ff33fc2582bb319d73ac.tar.gz
CMake-d4144b9c0a1a8a8f3a24ff33fc2582bb319d73ac.tar.bz2
strings: use `emplace_back` with `cmStrCat` arguments
-rw-r--r--Source/CPack/cmCPackInnoSetupGenerator.cxx8
-rw-r--r--Source/cmExportBuildFileGenerator.cxx4
-rw-r--r--Source/cmExportInstallFileGenerator.cxx4
-rw-r--r--Source/cmGlobalGhsMultiGenerator.cxx2
-rw-r--r--Source/cmGlobalVisualStudio10Generator.cxx6
-rw-r--r--Source/cmGlobalVisualStudio12Generator.cxx4
-rw-r--r--Source/cmGlobalVisualStudio14Generator.cxx4
-rw-r--r--Source/cmGlobalVisualStudio9Generator.cxx8
-rw-r--r--Source/cmGlobalVisualStudioVersionedGenerator.cxx4
-rw-r--r--Source/cmNinjaTargetGenerator.cxx3
-rw-r--r--Source/cmQtAutoMocUic.cxx2
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx2
12 files changed, 26 insertions, 25 deletions
diff --git a/Source/CPack/cmCPackInnoSetupGenerator.cxx b/Source/CPack/cmCPackInnoSetupGenerator.cxx
index ada9a5b..b8bf070 100644
--- a/Source/CPack/cmCPackInnoSetupGenerator.cxx
+++ b/Source/CPack/cmCPackInnoSetupGenerator.cxx
@@ -106,7 +106,7 @@ int cmCPackInnoSetupGenerator::PackageFiles()
const cmList extraScripts(GetOption("CPACK_INNOSETUP_EXTRA_SCRIPTS"));
for (const std::string& i : extraScripts) {
- includeDirectives.push_back(cmStrCat(
+ includeDirectives.emplace_back(cmStrCat(
"#include ", QuotePath(cmSystemTools::CollapseFullPath(i, toplevel))));
}
}
@@ -142,7 +142,7 @@ int cmCPackInnoSetupGenerator::PackageFiles()
const cmList codeFiles(GetOption("CPACK_INNOSETUP_CODE_FILES"));
for (const std::string& i : codeFiles) {
- codeIncludes.push_back(cmStrCat(
+ codeIncludes.emplace_back(cmStrCat(
"#include ", QuotePath(cmSystemTools::CollapseFullPath(i, toplevel))));
}
}
@@ -781,7 +781,7 @@ bool cmCPackInnoSetupGenerator::ConfigureISScript()
// Create internal variables
std::vector<std::string> setupSection;
for (const auto& i : setupDirectives) {
- setupSection.push_back(cmStrCat(i.first, '=', TranslateBool(i.second)));
+ setupSection.emplace_back(cmStrCat(i.first, '=', TranslateBool(i.second)));
}
// Also create comments if the sections are empty
@@ -1082,7 +1082,7 @@ std::string cmCPackInnoSetupGenerator::ISKeyValueLine(
std::vector<std::string> keys;
for (const char* i : availableKeys) {
if (params.count(i)) {
- keys.push_back(cmStrCat(i, ": ", params.at(i)));
+ keys.emplace_back(cmStrCat(i, ": ", params.at(i)));
}
}
diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index 8d3960c..fd35786 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -419,7 +419,7 @@ std::string cmExportBuildFileGenerator::GetFileSetDirectories(
resultVector.push_back(
cmStrCat("\"$<$<CONFIG:", config, ">:", dest, ">\""));
} else {
- resultVector.push_back(cmStrCat('"', dest, '"'));
+ resultVector.emplace_back(cmStrCat('"', dest, '"'));
break;
}
}
@@ -478,7 +478,7 @@ std::string cmExportBuildFileGenerator::GetFileSetFiles(cmGeneratorTarget* gte,
resultVector.push_back(
cmStrCat("\"$<$<CONFIG:", config, ">:", escapedFile, ">\""));
} else {
- resultVector.push_back(cmStrCat('"', escapedFile, '"'));
+ resultVector.emplace_back(cmStrCat('"', escapedFile, '"'));
}
}
}
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index 264c947..6cf3a09 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -616,7 +616,7 @@ std::string cmExportInstallFileGenerator::GetFileSetDirectories(
resultVector.push_back(
cmStrCat("\"$<$<CONFIG:", config, ">:", dest, ">\""));
} else {
- resultVector.push_back(cmStrCat('"', dest, '"'));
+ resultVector.emplace_back(cmStrCat('"', dest, '"'));
break;
}
}
@@ -690,7 +690,7 @@ std::string cmExportInstallFileGenerator::GetFileSetFiles(
resultVector.push_back(
cmStrCat("\"$<$<CONFIG:", config, ">:", escapedFile, ">\""));
} else {
- resultVector.push_back(cmStrCat('"', escapedFile, '"'));
+ resultVector.emplace_back(cmStrCat('"', escapedFile, '"'));
}
}
}
diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx
index 2453bfc..4ba53ec 100644
--- a/Source/cmGlobalGhsMultiGenerator.cxx
+++ b/Source/cmGlobalGhsMultiGenerator.cxx
@@ -670,7 +670,7 @@ bool cmGlobalGhsMultiGenerator::AddCheckTarget()
}
// Add the cache file.
- listFiles.push_back(cmStrCat(
+ listFiles.emplace_back(cmStrCat(
this->GetCMakeInstance()->GetHomeOutputDirectory(), "/CMakeCache.txt"));
// Print not implemented warning.
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index 41cd807..7a852f8 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -975,9 +975,9 @@ bool cmGlobalVisualStudio10Generator::FindVCTargetsPath(cmMakefile* mf)
std::vector<std::string> cmd;
cmd.push_back(this->GetMSBuildCommand());
cmd.push_back(vcxproj);
- cmd.push_back("/p:Configuration=Debug");
- cmd.push_back(cmStrCat("/p:Platform=", this->GetPlatformName()));
- cmd.push_back(cmStrCat("/p:VisualStudioVersion=", this->GetIDEVersion()));
+ cmd.emplace_back("/p:Configuration=Debug");
+ cmd.emplace_back(cmStrCat("/p:Platform=", this->GetPlatformName()));
+ cmd.emplace_back(cmStrCat("/p:VisualStudioVersion=", this->GetIDEVersion()));
std::string out;
int ret = 0;
cmsys::RegularExpression regex("\n *VCTargetsPath=([^%\r\n]+)[\r\n]");
diff --git a/Source/cmGlobalVisualStudio12Generator.cxx b/Source/cmGlobalVisualStudio12Generator.cxx
index 6c72c5d..1f1a2c3 100644
--- a/Source/cmGlobalVisualStudio12Generator.cxx
+++ b/Source/cmGlobalVisualStudio12Generator.cxx
@@ -80,8 +80,8 @@ public:
std::vector<std::string> GetGeneratorNamesWithPlatform() const override
{
std::vector<std::string> names;
- names.push_back(cmStrCat(vs12generatorName, " ARM"));
- names.push_back(cmStrCat(vs12generatorName, " Win64"));
+ names.emplace_back(cmStrCat(vs12generatorName, " ARM"));
+ names.emplace_back(cmStrCat(vs12generatorName, " Win64"));
return names;
}
diff --git a/Source/cmGlobalVisualStudio14Generator.cxx b/Source/cmGlobalVisualStudio14Generator.cxx
index 1350945..9f1926d 100644
--- a/Source/cmGlobalVisualStudio14Generator.cxx
+++ b/Source/cmGlobalVisualStudio14Generator.cxx
@@ -82,8 +82,8 @@ public:
std::vector<std::string> GetGeneratorNamesWithPlatform() const override
{
std::vector<std::string> names;
- names.push_back(cmStrCat(vs14generatorName, " ARM"));
- names.push_back(cmStrCat(vs14generatorName, " Win64"));
+ names.emplace_back(cmStrCat(vs14generatorName, " ARM"));
+ names.emplace_back(cmStrCat(vs14generatorName, " Win64"));
return names;
}
diff --git a/Source/cmGlobalVisualStudio9Generator.cxx b/Source/cmGlobalVisualStudio9Generator.cxx
index 462db2a..de2153d 100644
--- a/Source/cmGlobalVisualStudio9Generator.cxx
+++ b/Source/cmGlobalVisualStudio9Generator.cxx
@@ -72,21 +72,21 @@ public:
std::vector<std::string> GetGeneratorNames() const override
{
std::vector<std::string> names;
- names.push_back(vs9generatorName);
+ names.emplace_back(vs9generatorName);
return names;
}
std::vector<std::string> GetGeneratorNamesWithPlatform() const override
{
std::vector<std::string> names;
- names.push_back(cmStrCat(vs9generatorName, " Win64"));
- names.push_back(cmStrCat(vs9generatorName, " IA64"));
+ names.emplace_back(cmStrCat(vs9generatorName, " Win64"));
+ names.emplace_back(cmStrCat(vs9generatorName, " IA64"));
cmVisualStudioWCEPlatformParser parser;
parser.ParseVersion("9.0");
const std::vector<std::string>& availablePlatforms =
parser.GetAvailablePlatforms();
for (std::string const& i : availablePlatforms) {
- names.push_back(cmStrCat("Visual Studio 9 2008 ", i));
+ names.emplace_back(cmStrCat("Visual Studio 9 2008 ", i));
}
return names;
}
diff --git a/Source/cmGlobalVisualStudioVersionedGenerator.cxx b/Source/cmGlobalVisualStudioVersionedGenerator.cxx
index 938e4a3..52e6d42 100644
--- a/Source/cmGlobalVisualStudioVersionedGenerator.cxx
+++ b/Source/cmGlobalVisualStudioVersionedGenerator.cxx
@@ -265,8 +265,8 @@ public:
std::vector<std::string> GetGeneratorNamesWithPlatform() const override
{
std::vector<std::string> names;
- names.push_back(cmStrCat(vs15generatorName, " ARM"));
- names.push_back(cmStrCat(vs15generatorName, " Win64"));
+ names.emplace_back(cmStrCat(vs15generatorName, " ARM"));
+ names.emplace_back(cmStrCat(vs15generatorName, " Win64"));
return names;
}
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index d712d71..4837ee6 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -1052,7 +1052,8 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatements(
for (std::string const& l :
this->GetLinkedTargetDirectories(language, config)) {
- build.ImplicitDeps.push_back(cmStrCat(l, '/', language, "Modules.json"));
+ build.ImplicitDeps.emplace_back(
+ cmStrCat(l, '/', language, "Modules.json"));
}
this->GetGlobalGenerator()->WriteBuild(this->GetImplFileStream(fileConfig),
diff --git a/Source/cmQtAutoMocUic.cxx b/Source/cmQtAutoMocUic.cxx
index a101a81..62b5172 100644
--- a/Source/cmQtAutoMocUic.cxx
+++ b/Source/cmQtAutoMocUic.cxx
@@ -2116,7 +2116,7 @@ void cmQtAutoMocUicT::JobCompileMocT::MaybeWriteMocResponseFile(
cmd.resize(1);
// Specify response file
- cmd.push_back(cmStrCat('@', responseFile));
+ cmd.emplace_back(cmStrCat('@', responseFile));
}
#else
static_cast<void>(outputFile);
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 6e12402..5ba9332 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -4356,7 +4356,7 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions(
// first just full path
linkDirs.push_back(d);
// next path with configuration type Debug, Release, etc
- linkDirs.push_back(cmStrCat(d, "/$(Configuration)"));
+ linkDirs.emplace_back(cmStrCat(d, "/$(Configuration)"));
}
linkDirs.push_back("%(AdditionalLibraryDirectories)");
linkOptions.AddFlag("AdditionalLibraryDirectories", linkDirs);