From a4a5690cd32fc3633b9aa011dfc7c2460c2557b5 Mon Sep 17 00:00:00 2001 From: Marc Chevrier Date: Sat, 10 Jan 2026 16:03:29 +0100 Subject: CMake: Restore support for compiling as C++11 on Windows Fixes: #27505 --- Source/cmGlobalVisualStudioGenerator.cxx | 11 ++++++----- Source/cmVSSolution.cxx | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index 39086f7..84f036d 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -972,7 +972,8 @@ cm::VS::Solution cmGlobalVisualStudioGenerator::CreateSolution( if (!projectType.IsEmpty()) { project->TypeId = *projectType; } else { - project->TypeId = this->ExternalProjectTypeId(project->Path); + project->TypeId = + std::string{ this->ExternalProjectTypeId(project->Path) }; } for (std::string const& config : solution.Configs) { cmList mapConfig{ gt->GetProperty(cmStrCat( @@ -1005,13 +1006,13 @@ cm::VS::Solution cmGlobalVisualStudioGenerator::CreateSolution( cm::string_view vcprojExt; if (this->TargetIsFortranOnly(gt)) { vcprojExt = ".vfproj"_s; - project->TypeId = Solution::Project::TypeIdFortran; + project->TypeId = std::string{ Solution::Project::TypeIdFortran }; } else if (gt->IsCSharpOnly()) { vcprojExt = ".csproj"_s; - project->TypeId = Solution::Project::TypeIdCSharp; + project->TypeId = std::string{ Solution::Project::TypeIdCSharp }; } else { vcprojExt = ".vcproj"_s; - project->TypeId = Solution::Project::TypeIdDefault; + project->TypeId = std::string{ Solution::Project::TypeIdDefault }; } if (cmValue genExt = gt->GetProperty("GENERATOR_FILE_NAME_EXT")) { vcprojExt = *genExt; @@ -1064,7 +1065,7 @@ cm::VS::Solution cmGlobalVisualStudioGenerator::CreateSolution( cmSourceGroup* sg = mf->FindSourceGroup(item, sourceGroups); std::string folderName = sg->GetFullName(); if (folderName.empty()) { - folderName = "Solution Items"_s; + folderName = "Solution Items"; } Solution::Folder* folder = this->CreateSolutionFolder(solution, folderName); diff --git a/Source/cmVSSolution.cxx b/Source/cmVSSolution.cxx index 2ec3f02..cc75b8a 100644 --- a/Source/cmVSSolution.cxx +++ b/Source/cmVSSolution.cxx @@ -64,7 +64,7 @@ T* GetEntry(std::map>& entryMap, auto i = entryMap.find(name); if (i == entryMap.end()) { auto p = cm::make_unique(); - p->Name = name; + p->Name = std::string{ name }; i = entryMap.emplace(p->Name, std::move(p)).first; } return i->second.get(); -- cgit v0.12