1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-15 20:46:37 +08:00

FASTBuild: fix excessive std::to_string

`cmStrCat` uses `cmAlphaNum` internally
which does conversion from integer to string
This commit is contained in:
Eduard Voronkin
2025-09-21 17:29:53 -07:00
parent 7e0d79dfa7
commit a63c1b4a84
2 changed files with 5 additions and 8 deletions

View File

@@ -1375,8 +1375,7 @@ void cmFastbuildNormalTargetGenerator::GenerateObjects(FastbuildTarget& target)
for (auto& val : nodesPermutations) {
auto& objectListNode = val.second;
objectListNode.Name =
cmStrCat(objectListNode.Name, "_", std::to_string(++groupNameCount));
objectListNode.Name = cmStrCat(objectListNode.Name, "_", ++groupNameCount);
LogMessage(cmStrCat("ObjectList name: ", objectListNode.Name));
}
std::vector<FastbuildObjectListNode>& objects = target.ObjectListNodes;
@@ -1476,8 +1475,7 @@ cmFastbuildNormalTargetGenerator::GenerateUnity(
while (!obj.CompilerInputFiles.empty()) {
FastbuildUnityNode node =
GetOneUnity(isolatedSources, obj.CompilerInputFiles, unitySize);
node.Name =
cmStrCat(this->GetName(), "_Unity_", std::to_string(++unityNumber));
node.Name = cmStrCat(this->GetName(), "_Unity_", ++unityNumber);
node.UnityOutputPath = obj.CompilerOutputPath;
node.UnityOutputPattern = cmStrCat(node.Name, ext);
@@ -1523,8 +1521,8 @@ FastbuildUnityNode cmFastbuildNormalTargetGenerator::GenerateGroupedUnityNode(
if (iter == inputFiles.end()) {
continue;
}
node.Name = cmStrCat(this->GetName(), "_Unity_Group_", group, '_',
std::to_string(++groupId));
node.Name =
cmStrCat(this->GetName(), "_Unity_Group_", group, '_', ++groupId);
node.UnityInputFiles.emplace_back(source);
// Remove from the general batching.

View File

@@ -1590,8 +1590,7 @@ void cmGlobalFastbuildGenerator::WriteSolution()
std::move(projectsInFolder.begin(), projectsInFolder.end(),
std::back_inserter(VSProjectsWithoutFolder));
} else {
std::string folderName =
cmStrCat("Folder_", std::to_string(++folderNumber));
std::string folderName = cmStrCat("Folder_", ++folderNumber);
WriteStruct(
folderName,
{ { "Path", Quote(pathToFolder) },