cmVisualStudioSlnParser: Fix storage of some .sln parse results

In commit 5cdd774d51 (VS: Handle build target correct for .NET SDK style
projects with Any CPU, 2022-02-02, v3.23.0-rc1~3^2), some parse results
were stored in temporary copies of `cmSlnProjectEntry` and thrown away.
This commit is contained in:
Brad King
2025-09-12 17:31:02 -04:00
parent 54769660e1
commit 0a17f4e996
4 changed files with 18 additions and 20 deletions
+1 -2
View File
@@ -1131,8 +1131,7 @@ cmGlobalVisualStudio10Generator::GenerateBuildCommand(
std::string targetProject = cmStrCat(tname, ".vcxproj");
if (targetProject.find('/') == std::string::npos) {
// it might be in a subdir
if (cm::optional<cmSlnProjectEntry> proj =
slnData.GetProjectByName(tname)) {
if (cmSlnProjectEntry const* proj = slnData.GetProjectByName(tname)) {
targetProject = proj->GetRelativePath();
cmSystemTools::ConvertToUnixSlashes(targetProject);
}