Skip to content

Commit 771985b

Browse files
authored
Add support for ARM and ARM64 (#446)
1 parent a76f2fd commit 771985b

File tree

3 files changed

+54
-2
lines changed

3 files changed

+54
-2
lines changed

src/Microsoft.VisualStudio.SlnGen.UnitTests/SlnFileTests.cs

+27-1
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,35 @@ public void CustomConfigurationAndPlatforms()
7474
ProjectTypeGuid = Guid.NewGuid(),
7575
};
7676

77+
SlnProject projectF = new SlnProject
78+
{
79+
Configurations = new[] { "Debug" },
80+
FullPath = GetTempFileName(),
81+
IsMainProject = true,
82+
Name = "ProjectF",
83+
Platforms = new[] { "ARM" },
84+
ProjectGuid = Guid.NewGuid(),
85+
ProjectTypeGuid = Guid.NewGuid(),
86+
};
87+
88+
SlnProject projectG = new SlnProject
89+
{
90+
Configurations = new[] { "Debug" },
91+
FullPath = GetTempFileName(),
92+
IsMainProject = true,
93+
Name = "ProjectG",
94+
Platforms = new[] { "ARM64" },
95+
ProjectGuid = Guid.NewGuid(),
96+
ProjectTypeGuid = Guid.NewGuid(),
97+
};
98+
7799
SlnFile slnFile = new SlnFile()
78100
{
79101
Configurations = new[] { "Debug" },
80102
Platforms = new[] { "Any CPU" },
81103
};
82104

83-
slnFile.AddProjects(new[] { projectA, projectB, projectC, projectD, projectE });
105+
slnFile.AddProjects(new[] { projectA, projectB, projectC, projectD, projectE, projectF, projectG });
84106

85107
string solutionFilePath = GetTempFileName();
86108

@@ -97,6 +119,10 @@ public void CustomConfigurationAndPlatforms()
97119
ValidateSolutionPlatformAndConfiguration(projectD, solutionFile, "Debug", "Razzle", expectedIncludeInBuild: false);
98120

99121
ValidateSolutionPlatformAndConfiguration(projectE, solutionFile, "Release", "AnyCPU", expectedIncludeInBuild: true);
122+
123+
ValidateSolutionPlatformAndConfiguration(projectF, solutionFile, "Debug", "ARM");
124+
125+
ValidateSolutionPlatformAndConfiguration(projectG, solutionFile, "Debug", "ARM64");
100126
}
101127

102128
[Fact]

src/Microsoft.VisualStudio.SlnGen/SlnFile.cs

+26
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,8 @@ private IEnumerable<string> GetValidSolutionPlatforms(IEnumerable<string> platfo
590590
"x86" => platform,
591591
"amd64" => "x64",
592592
"win32" => "x86",
593+
"arm" => platform,
594+
"arm64" => platform,
593595
_ => null
594596
};
595597
})
@@ -627,6 +629,8 @@ private bool TryGetProjectSolutionPlatform(string solutionPlatform, SlnProject p
627629
bool containsAmd64 = false;
628630
bool containsX86 = false;
629631
bool containsAnyCPU = false;
632+
bool containsArm = false;
633+
bool containsArm64 = false;
630634

631635
foreach (string projectPlatform in project.Platforms)
632636
{
@@ -661,6 +665,14 @@ private bool TryGetProjectSolutionPlatform(string solutionPlatform, SlnProject p
661665
case "win32":
662666
containsWin32 = true;
663667
break;
668+
669+
case "arm":
670+
containsArm = true;
671+
break;
672+
673+
case "arm64":
674+
containsArm64 = true;
675+
break;
664676
}
665677
}
666678

@@ -693,6 +705,20 @@ private bool TryGetProjectSolutionPlatform(string solutionPlatform, SlnProject p
693705

694706
return true;
695707
}
708+
709+
if (containsArm)
710+
{
711+
projectSolutionPlatform = projectBuildPlatform = "ARM";
712+
713+
return true;
714+
}
715+
716+
if (containsArm64)
717+
{
718+
projectSolutionPlatform = projectBuildPlatform = "ARM64";
719+
720+
return true;
721+
}
696722
}
697723

698724
if (string.Equals(solutionPlatform, "x86", StringComparison.OrdinalIgnoreCase))

version.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/AArnott/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
3-
"version": "9.4",
3+
"version": "9.5",
44
"assemblyVersion": "3.0",
55
"buildNumberOffset": 0,
66
"publicReleaseRefSpec": [

0 commit comments

Comments
 (0)