Allow for better support for running on m1/2 machines

* So we need to account for 2 possible situations where you are running under and emulated process and a native process with a different target host in this case x64
This commit is contained in:
Andrew Spiering
2023-09-20 09:12:48 -07:00
parent 3ede4c2192
commit 821c373ae2
2 changed files with 22 additions and 2 deletions

View File

@@ -215,8 +215,12 @@ namespace Flax.Build
}
}
// Use x64 when cross-compiling from ARM64
if (architecture == TargetArchitecture.ARM64 && (Configuration.BuildArchitectures != null && Configuration.BuildArchitectures[0] == TargetArchitecture.x64))
bool isRunningOnArm64Targetx64 = architecture == TargetArchitecture.ARM64 && (Configuration.BuildArchitectures != null && Configuration.BuildArchitectures[0] == TargetArchitecture.x64);
// We need to support two paths here:
// 1. We are running an x64 binary and we are running on an arm64 host machine
// 2. We are running an Arm64 binary and we are targeting an x64 host machine
if (Flax.Build.Platforms.MacPlatform.GetProcessIsTranslated() || isRunningOnArm64Targetx64)
{
rid = "osx-x64";
dotnetPath = Path.Combine(dotnetPath, "x64");