Merge topic 'Windows-compilation-c++11' into release-4.2

a4a5690cd3 CMake: Restore support for compiling as C++11 on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11586
This commit is contained in:
Brad King
2026-01-13 15:26:17 +00:00
committed by Kitware Robot
2 changed files with 7 additions and 6 deletions

View File

@@ -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);

View File

@@ -64,7 +64,7 @@ T* GetEntry(std::map<cm::string_view, std::unique_ptr<T>>& entryMap,
auto i = entryMap.find(name);
if (i == entryMap.end()) {
auto p = cm::make_unique<T>();
p->Name = name;
p->Name = std::string{ name };
i = entryMap.emplace(p->Name, std::move(p)).first;
}
return i->second.get();