Skip to content

Commit 441da00

Browse files
committed
Fix unity mono build error at windows
1 parent 5cd8e64 commit 441da00

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

extra/UniversalCompiler/Program.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,20 @@ private static ProcessStartInfo OSDependentStartInfo(ProcessRuntime processRunti
348348

349349
if (CurrentPlatform == Platform.Windows)
350350
{
351-
startInfo = new ProcessStartInfo(processPath, processArguments);
351+
switch (processRuntime)
352+
{
353+
case ProcessRuntime.CLR20:
354+
var runtimePath = Path.Combine(unityEditorDataDir, @"Mono/bin/mono.exe");
355+
startInfo = new ProcessStartInfo(runtimePath, $"\"{processPath}\" {processArguments}");
356+
break;
357+
358+
case ProcessRuntime.CLR40:
359+
startInfo = new ProcessStartInfo(processPath, processArguments);
360+
break;
361+
362+
default:
363+
throw new ArgumentOutOfRangeException(nameof(processRuntime), processRuntime, null);
364+
}
352365
}
353366
else
354367
{

0 commit comments

Comments
 (0)