Fixes
This commit is contained in:
@@ -181,7 +181,7 @@ namespace Flax.Build.Platforms
|
||||
case TargetArchitecture.ARM64: return "aarch64-unknown-linux-gnueabi";
|
||||
default: throw new InvalidArchitectureException(architecture);
|
||||
}
|
||||
case TargetPlatform.PS4: return "orbis";
|
||||
case TargetPlatform.PS4: return (string)Utilities.GetStaticValue("Flax.Build.Platforms.PS4Toolchain", "ToolchainName");
|
||||
case TargetPlatform.Android:
|
||||
switch (architecture)
|
||||
{
|
||||
|
||||
@@ -5,6 +5,7 @@ using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
|
||||
namespace Flax.Build
|
||||
@@ -43,6 +44,23 @@ namespace Flax.Build
|
||||
return Enumerable.Empty<T>() as T[];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the static field value from a given type.
|
||||
/// </summary>
|
||||
/// <param name="typeName">Name of the type.</param>
|
||||
/// <param name="fieldName">Name of the field.</param>
|
||||
/// <returns>The field value.</returns>
|
||||
public static object GetStaticValue(string typeName, string fieldName)
|
||||
{
|
||||
var type = Type.GetType(typeName);
|
||||
if (type == null)
|
||||
throw new Exception($"Cannot find type \'{typeName}\'.");
|
||||
var field = type.GetField(fieldName, BindingFlags.Public | BindingFlags.Static);
|
||||
if (field == null)
|
||||
throw new Exception($"Cannot find static public field \'{fieldName}\' in \'{typeName}\'.");
|
||||
return field.GetValue(null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the size of the file as a readable string.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user