Various porting patches

This commit is contained in:
Wojtek Figat
2024-01-22 21:17:58 +01:00
parent 37fe11e19f
commit a0e127b9cc
4 changed files with 37 additions and 10 deletions

View File

@@ -74,12 +74,24 @@ public class nethost : ThirdPartyModule
case TargetPlatform.Switch:
case TargetPlatform.PS4:
case TargetPlatform.PS5:
options.OutputFiles.Add(Path.Combine(hostRuntime.Path, "libmonosgen-2.0.a"));
options.OutputFiles.Add(Path.Combine(hostRuntime.Path, "libSystem.Native.a"));
options.OutputFiles.Add(Path.Combine(hostRuntime.Path, "libSystem.IO.Ports.Native.a"));
options.OutputFiles.Add(Path.Combine(hostRuntime.Path, "libSystem.IO.Compression.Native.a"));
options.OutputFiles.Add(Path.Combine(hostRuntime.Path, "libSystem.Globalization.Native.a"));
{
var type = Flax.Build.Utilities.GetType($"Flax.Build.Platforms.{options.Platform.Target}.nethost");
var onLink = type?.GetMethod("OnLink");
if (onLink != null)
{
// Custom linking logic overriden by platform tools
onLink.Invoke(null, new object[] { options, hostRuntime.Path });
}
else
{
options.OutputFiles.Add(Path.Combine(hostRuntime.Path, "libmonosgen-2.0.a"));
options.OutputFiles.Add(Path.Combine(hostRuntime.Path, "libSystem.Native.a"));
options.OutputFiles.Add(Path.Combine(hostRuntime.Path, "libSystem.IO.Ports.Native.a"));
options.OutputFiles.Add(Path.Combine(hostRuntime.Path, "libSystem.IO.Compression.Native.a"));
options.OutputFiles.Add(Path.Combine(hostRuntime.Path, "libSystem.Globalization.Native.a"));
}
break;
}
case TargetPlatform.Android:
options.PublicDefinitions.Add("USE_MONO_DYNAMIC_LIB");
options.DependencyFiles.Add(Path.Combine(hostRuntime.Path, "libmonosgen-2.0.so"));