Skip to content

Commit 5799028

Browse files
authored
Merge pull request #6903 from keveleigh/arm64
Add ARM64 support to build window for Unity 2019 and support multiple VS versions side-by-side
2 parents 867759b + 4975c57 commit 5799028

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

Assets/MixedRealityToolkit/Utilities/BuildAndDeploy/BuildDeployWindow.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ private enum Architecture
3939
x86 = 0,
4040
x64 = 1,
4141
ARM = 2,
42+
#if UNITY_2019_1_OR_NEWER
43+
ARM64 = 3
44+
#endif // UNITY_2019_1_OR_NEWER
4245
}
4346

4447
private enum PlatformToolset
@@ -584,6 +587,12 @@ private void AppxBuildGUI()
584587
{
585588
buildArchitecture = Architecture.ARM;
586589
}
590+
#if UNITY_2019_1_OR_NEWER
591+
else if (currentArchitectureString.ToLower().Equals("arm64"))
592+
{
593+
buildArchitecture = Architecture.ARM64;
594+
}
595+
#endif // UNITY_2019_1_OR_NEWER
587596

588597
buildArchitecture = (Architecture)EditorGUILayout.EnumPopup("Build Platform", buildArchitecture, GUILayout.Width(HALF_WIDTH));
589598

Assets/MixedRealityToolkit/Utilities/BuildAndDeploy/UwpAppxBuildTools.cs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,17 @@ private static async Task<string> FindMsBuildPathAsync()
174174
// have VS2017 or VS2019 installed.
175175
foreach (VSWhereFindOption findOption in VSWhereFindOptions)
176176
{
177+
string arguments = findOption.arguments;
178+
if (string.IsNullOrWhiteSpace(EditorUserBuildSettings.wsaUWPVisualStudioVersion))
179+
{
180+
arguments += " -latest";
181+
}
182+
else
183+
{
184+
// Add version number with brackets to find only the specified version
185+
arguments += $" -version [{EditorUserBuildSettings.wsaUWPVisualStudioVersion}]";
186+
}
187+
177188
var result = await new Process().StartProcessAsync(
178189
new ProcessStartInfo
179190
{
@@ -182,7 +193,7 @@ private static async Task<string> FindMsBuildPathAsync()
182193
UseShellExecute = false,
183194
RedirectStandardOutput = true,
184195
RedirectStandardError = true,
185-
Arguments = findOption.arguments,
196+
Arguments = arguments,
186197
WorkingDirectory = @"C:\Program Files (x86)\Microsoft Visual Studio\Installer"
187198
});
188199

@@ -623,12 +634,12 @@ public VSWhereFindOption(string args, string suffix)
623634
{
624635
// This find option corresponds to the version of vswhere that ships with VS2019.
625636
new VSWhereFindOption(
626-
$@"/C vswhere -all -products * -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe",
637+
@"/C vswhere -all -products * -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe",
627638
""),
628639
// This find option corresponds to the version of vswhere that ships with VS2017 - this doesn't have
629640
// support for the -find command switch.
630641
new VSWhereFindOption(
631-
$@"/C vswhere -all -products * -requires Microsoft.Component.MSBuild -property installationPath",
642+
@"/C vswhere -all -products * -requires Microsoft.Component.MSBuild -property installationPath",
632643
"\\MSBuild\\15.0\\Bin\\MSBuild.exe"),
633644
};
634645
}

0 commit comments

Comments
 (0)