Add Platform.BuildTargetArchitecture
This commit is contained in:
@@ -5,6 +5,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Diagnostics;
|
||||
using Flax.Build.NativeCpp;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Flax.Build
|
||||
{
|
||||
@@ -66,6 +67,29 @@ namespace Flax.Build
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current target architecture that build tool runs on.
|
||||
/// </summary>
|
||||
public static TargetArchitecture BuildTargetArchitecture
|
||||
{
|
||||
get
|
||||
{
|
||||
var architectureId = RuntimeInformation.ProcessArchitecture;
|
||||
switch (architectureId)
|
||||
{
|
||||
case Architecture.X86:
|
||||
return TargetArchitecture.x86;
|
||||
case Architecture.X64:
|
||||
return TargetArchitecture.x64;
|
||||
case Architecture.Arm:
|
||||
return TargetArchitecture.ARM;
|
||||
case Architecture.Arm64:
|
||||
return TargetArchitecture.ARM64;
|
||||
default: throw new NotImplementedException(string.Format("Unsupported build platform {0}.", architectureId));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current platform that build tool runs on.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user