Use bundled mono on Linux for C# compilation

This commit is contained in:
mafiesto4
2021-02-14 23:04:42 +01:00
parent ff44622624
commit c68e3af566
2 changed files with 22 additions and 21 deletions

View File

@@ -44,9 +44,20 @@ namespace Flax.Build
var outputPath = Path.GetDirectoryName(buildData.Target.GetOutputFilePath(buildOptions));
var outputFile = Path.Combine(outputPath, binaryModuleName + ".CSharp.dll");
var outputDocFile = Path.Combine(outputPath, binaryModuleName + ".CSharp.xml");
var monoRoot = Path.Combine(Globals.EngineRoot, "Source", "Platforms", "Editor", "Windows", "Mono");
string monoRoot, exePath;
switch (buildPlatform)
{
case TargetPlatform.Windows:
monoRoot = Path.Combine(Globals.EngineRoot, "Source", "Platforms", "Editor", "Windows", "Mono");
exePath = Path.Combine(monoRoot, "bin", "mono.exe");
break;
case TargetPlatform.Linux:
monoRoot = Path.Combine(Globals.EngineRoot, "Source", "Platforms", "Editor", "Linux", "Mono");
exePath = Path.Combine(monoRoot, "bin", "mono");
break;
default: throw new InvalidPlatformException(buildPlatform);
}
var cscPath = Path.Combine(monoRoot, "lib", "mono", "4.5", "csc.exe");
var exePath = buildPlatform == TargetPlatform.Windows ? Path.Combine(monoRoot, "bin", "mono.exe") : "mono";
var referenceAssemblies = Path.Combine(monoRoot, "lib", "mono", "4.5-api");
var references = new HashSet<string>(buildOptions.ScriptingAPI.FileReferences);
foreach (var module in binaryModule)