@@ -554,11 +554,11 @@ private void RunIl2CppWithArguments(List<string> arguments, Action<ProcessStartI
554554 il2cppOutputParser = new Il2CppOutputParser ( ) ;
555555
556556 if ( ShouldUseIl2CppCore ( ) )
557- il2cppSettings . ToolPath = GetIl2CppCoreExe ( ) ;
557+ il2cppSettings . ToolPath = $ " { EscapeSpacesInPath ( GetIl2CppCoreExe ( ) ) } " ;
558558 else if ( Application . platform == RuntimePlatform . WindowsEditor )
559- il2cppSettings . ToolPath = GetIl2CppExe ( ) ;
559+ il2cppSettings . ToolPath = $ " { EscapeSpacesInPath ( GetIl2CppExe ( ) ) } " ;
560560 else
561- il2cppSettings . ToolPath = $ "{ GetMonoBleedingEdgeExe ( ) } { GetIl2CppExe ( ) } ";
561+ il2cppSettings . ToolPath = $ "{ EscapeSpacesInPath ( GetMonoBleedingEdgeExe ( ) ) } { EscapeSpacesInPath ( GetIl2CppExe ( ) ) } ";
562562
563563 il2cppSettings . Arguments . AddRange ( arguments ) ;
564564 il2cppSettings . Serialize ( m_PlatformProvider . il2cppBuildCacheDirectory ) ;
@@ -568,8 +568,11 @@ void SetupTundraAndStartInfo(ProcessStartInfo startInfo)
568568 {
569569 if ( setupStartInfo != null )
570570 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
571574 startInfo . EnvironmentVariables . Add ( "TUNDRA_EXECUTABLE" , GetIl2CppTundraExe ( ) ) ;
572- startInfo . EnvironmentVariables . Add ( "MONO_EXECUTABLE" , GetMonoBleedingEdgeExe ( ) ) ;
575+ startInfo . EnvironmentVariables . Add ( "MONO_EXECUTABLE" , EscapeSpacesInPath ( GetMonoBleedingEdgeExe ( ) ) ) ;
573576 }
574577
575578 Console . WriteLine ( "Invoking il2cpp with arguments: " + args ) ;
@@ -591,42 +594,47 @@ void SetupTundraAndStartInfo(ProcessStartInfo startInfo)
591594 }
592595 }
593596
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+
594604 private string GetIl2CppExe ( )
595605 {
596- return IL2CPPUtils . GetIl2CppFolder ( ) + " /build/deploy/net471/il2cpp.exe";
606+ return $ " { IL2CPPUtils . GetIl2CppFolder ( ) } /build/deploy/net471/il2cpp.exe";
597607 }
598608
599609 private string GetIl2CppCoreExe ( )
600610 {
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" : "" ) } " ;
602612 }
603613
604614 private string GetIl2CppBeeExe ( )
605615 {
606- return IL2CPPUtils . GetIl2CppFolder ( ) + " /BeeRunner/bee.exe";
616+ return $ " { IL2CPPUtils . GetIl2CppFolder ( ) } /BeeRunner/bee.exe";
607617 }
608618
609619 private string GetIl2CppBeeArtifactsDirectory ( )
610620 {
611- return IL2CPPUtils . GetIl2CppFolder ( ) + " /BeeRunner/artifacts";
621+ return $ " { IL2CPPUtils . GetIl2CppFolder ( ) } /BeeRunner/artifacts";
612622 }
613623
614624 private string GetIl2CppTundraExe ( )
615625 {
616626 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";
618628 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";
620630
621- return IL2CPPUtils . GetIl2CppFolder ( ) + " /BeeRunner/tundra/tundra-win-x64/tundra2.exe";
631+ return $ " { IL2CPPUtils . GetIl2CppFolder ( ) } /BeeRunner/tundra/tundra-win-x64/tundra2.exe";
622632 }
623633
624634 private string GetMonoBleedingEdgeExe ( )
625635 {
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" ) ;
630638 }
631639
632640 private bool ShouldUseIl2CppCore ( )
0 commit comments