@@ -554,11 +554,11 @@ private void RunIl2CppWithArguments(List<string> arguments, Action<ProcessStartI
554
554
il2cppOutputParser = new Il2CppOutputParser ( ) ;
555
555
556
556
if ( ShouldUseIl2CppCore ( ) )
557
- il2cppSettings . ToolPath = GetIl2CppCoreExe ( ) ;
557
+ il2cppSettings . ToolPath = $ " { EscapeSpacesInPath ( GetIl2CppCoreExe ( ) ) } " ;
558
558
else if ( Application . platform == RuntimePlatform . WindowsEditor )
559
- il2cppSettings . ToolPath = GetIl2CppExe ( ) ;
559
+ il2cppSettings . ToolPath = $ " { EscapeSpacesInPath ( GetIl2CppExe ( ) ) } " ;
560
560
else
561
- il2cppSettings . ToolPath = $ "{ GetMonoBleedingEdgeExe ( ) } { GetIl2CppExe ( ) } ";
561
+ il2cppSettings . ToolPath = $ "{ EscapeSpacesInPath ( GetMonoBleedingEdgeExe ( ) ) } { EscapeSpacesInPath ( GetIl2CppExe ( ) ) } ";
562
562
563
563
il2cppSettings . Arguments . AddRange ( arguments ) ;
564
564
il2cppSettings . Serialize ( m_PlatformProvider . il2cppBuildCacheDirectory ) ;
@@ -568,8 +568,11 @@ void SetupTundraAndStartInfo(ProcessStartInfo startInfo)
568
568
{
569
569
if ( setupStartInfo != null )
570
570
setupStartInfo ( startInfo ) ;
571
+
572
+ // For some reason, TUNDRA_EXECUTABLE needs to be unescaped in order to be found on OSX,
573
+ // but MONO_EXECUTABLE needs to be escaped in order to be found on OSX
571
574
startInfo . EnvironmentVariables . Add ( "TUNDRA_EXECUTABLE" , GetIl2CppTundraExe ( ) ) ;
572
- startInfo . EnvironmentVariables . Add ( "MONO_EXECUTABLE" , GetMonoBleedingEdgeExe ( ) ) ;
575
+ startInfo . EnvironmentVariables . Add ( "MONO_EXECUTABLE" , EscapeSpacesInPath ( GetMonoBleedingEdgeExe ( ) ) ) ;
573
576
}
574
577
575
578
Console . WriteLine ( "Invoking il2cpp with arguments: " + args ) ;
@@ -591,42 +594,47 @@ void SetupTundraAndStartInfo(ProcessStartInfo startInfo)
591
594
}
592
595
}
593
596
597
+ private string EscapeSpacesInPath ( string path )
598
+ {
599
+ if ( Application . platform == RuntimePlatform . WindowsEditor )
600
+ return CommandLineFormatter . EscapeCharsWindows ( path ) ;
601
+ return CommandLineFormatter . EscapeCharsQuote ( path ) ;
602
+ }
603
+
594
604
private string GetIl2CppExe ( )
595
605
{
596
- return IL2CPPUtils . GetIl2CppFolder ( ) + " /build/deploy/net471/il2cpp.exe";
606
+ return $ " { IL2CPPUtils . GetIl2CppFolder ( ) } /build/deploy/net471/il2cpp.exe";
597
607
}
598
608
599
609
private string GetIl2CppCoreExe ( )
600
610
{
601
- return IL2CPPUtils . GetIl2CppFolder ( ) + " /build/deploy/netcoreapp3.0/il2cpp" + ( Application . platform == RuntimePlatform . WindowsEditor ? ".exe" : "" ) ;
611
+ return $ " { IL2CPPUtils . GetIl2CppFolder ( ) } /build/deploy/netcoreapp3.0/il2cpp{ ( Application . platform == RuntimePlatform . WindowsEditor ? ".exe" : "" ) } " ;
602
612
}
603
613
604
614
private string GetIl2CppBeeExe ( )
605
615
{
606
- return IL2CPPUtils . GetIl2CppFolder ( ) + " /BeeRunner/bee.exe";
616
+ return $ " { IL2CPPUtils . GetIl2CppFolder ( ) } /BeeRunner/bee.exe";
607
617
}
608
618
609
619
private string GetIl2CppBeeArtifactsDirectory ( )
610
620
{
611
- return IL2CPPUtils . GetIl2CppFolder ( ) + " /BeeRunner/artifacts";
621
+ return $ " { IL2CPPUtils . GetIl2CppFolder ( ) } /BeeRunner/artifacts";
612
622
}
613
623
614
624
private string GetIl2CppTundraExe ( )
615
625
{
616
626
if ( Application . platform == RuntimePlatform . OSXEditor )
617
- return IL2CPPUtils . GetIl2CppFolder ( ) + " /BeeRunner/tundra/tundra-mac-x64/tundra2";
627
+ return $ " { IL2CPPUtils . GetIl2CppFolder ( ) } /BeeRunner/tundra/tundra-mac-x64/tundra2";
618
628
if ( Application . platform == RuntimePlatform . LinuxEditor )
619
- return IL2CPPUtils . GetIl2CppFolder ( ) + " /BeeRunner/tundra/tundra-linux-x64/tundra2";
629
+ return $ " { IL2CPPUtils . GetIl2CppFolder ( ) } /BeeRunner/tundra/tundra-linux-x64/tundra2";
620
630
621
- return IL2CPPUtils . GetIl2CppFolder ( ) + " /BeeRunner/tundra/tundra-win-x64/tundra2.exe";
631
+ return $ " { IL2CPPUtils . GetIl2CppFolder ( ) } /BeeRunner/tundra/tundra-win-x64/tundra2.exe";
622
632
}
623
633
624
634
private string GetMonoBleedingEdgeExe ( )
625
635
{
626
- var path = MonoInstallationFinder . GetMonoInstallation ( "MonoBleedingEdge" ) ;
627
- path = Path . Combine ( path , "bin" ) ;
628
- path = Path . Combine ( path , "mono" ) ;
629
- return path ;
636
+ var path = Path . Combine ( MonoInstallationFinder . GetMonoInstallation ( "MonoBleedingEdge" ) , "bin" ) ;
637
+ return Path . Combine ( path , "mono" ) ;
630
638
}
631
639
632
640
private bool ShouldUseIl2CppCore ( )
0 commit comments