Update Switch platform support
This commit is contained in:
@@ -1026,28 +1026,33 @@ namespace Flax.Build.Platforms
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool CompileCSharp(CSharpOptions options)
|
||||
public override bool CompileCSharp(ref CSharpOptions options)
|
||||
{
|
||||
if (options.Action != CSharpOptions.ActionTypes.MonoCompile)
|
||||
return true;
|
||||
var aotCompilerPath = Path.Combine(options.PlatformsToolsPath, "mono-aot-cross.exe");
|
||||
|
||||
// Setup options
|
||||
var monoAotMode = "full";
|
||||
var monoDebugMode = options.EnableDebugSymbols ? "soft-debug" : "nodebug";
|
||||
var aotCompilerArgs = $"--aot={monoAotMode},verbose,stats,print-skipped,{monoDebugMode} -O=all";
|
||||
if (options.EnableDebugSymbols || options.EnableToolDebug)
|
||||
aotCompilerArgs = "--debug " + aotCompilerArgs;
|
||||
var envVars = new Dictionary<string, string>();
|
||||
envVars["MONO_PATH"] = options.AssembliesPath + ";" + options.ClassLibraryPath;
|
||||
if (options.EnableToolDebug)
|
||||
switch (options.Action)
|
||||
{
|
||||
envVars["MONO_LOG_LEVEL"] = "debug";
|
||||
}
|
||||
case CSharpOptions.ActionTypes.MonoCompile:
|
||||
{
|
||||
var aotCompilerPath = Path.Combine(options.PlatformsToolsPath, "mono-aot-cross.exe");
|
||||
|
||||
// Run cross-compiler compiler
|
||||
int result = Utilities.Run(aotCompilerPath, $"{aotCompilerArgs} \"{options.InputFile}\"", null, options.PlatformsToolsPath, Utilities.RunOptions.AppMustExist | Utilities.RunOptions.ConsoleLogOutput, envVars);
|
||||
return result != 0;
|
||||
// Setup options
|
||||
var monoAotMode = "full";
|
||||
var monoDebugMode = options.EnableDebugSymbols ? "soft-debug" : "nodebug";
|
||||
var aotCompilerArgs = $"--aot={monoAotMode},verbose,stats,print-skipped,{monoDebugMode} -O=all";
|
||||
if (options.EnableDebugSymbols || options.EnableToolDebug)
|
||||
aotCompilerArgs = "--debug " + aotCompilerArgs;
|
||||
var envVars = new Dictionary<string, string>();
|
||||
envVars["MONO_PATH"] = options.AssembliesPath + ";" + options.ClassLibraryPath;
|
||||
if (options.EnableToolDebug)
|
||||
{
|
||||
envVars["MONO_LOG_LEVEL"] = "debug";
|
||||
}
|
||||
|
||||
// Run cross-compiler compiler
|
||||
int result = Utilities.Run(aotCompilerPath, $"{aotCompilerArgs} \"{options.InputFiles[0]}\"", null, options.PlatformsToolsPath, Utilities.RunOptions.AppMustExist | Utilities.RunOptions.ConsoleLogOutput, envVars);
|
||||
return result != 0;
|
||||
}
|
||||
}
|
||||
return base.CompileCSharp(ref options);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user