From 301bf41fab41e6ce5bea2ccd14b8d9d877965496 Mon Sep 17 00:00:00 2001 From: Ari Vuollet Date: Wed, 25 Sep 2024 17:38:29 +0300 Subject: [PATCH] Fix ARM64 compiler support detection with MSVC v140 toolset --- .../Platforms/Windows/WindowsPlatformBase.cs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Source/Tools/Flax.Build/Platforms/Windows/WindowsPlatformBase.cs b/Source/Tools/Flax.Build/Platforms/Windows/WindowsPlatformBase.cs index ae6819859..215bb32e8 100644 --- a/Source/Tools/Flax.Build/Platforms/Windows/WindowsPlatformBase.cs +++ b/Source/Tools/Flax.Build/Platforms/Windows/WindowsPlatformBase.cs @@ -433,7 +433,12 @@ namespace Flax.Build.Platforms { case WindowsPlatformToolset.v140: { - if (hostArchitecture != TargetArchitecture.x86) + if (architecture == TargetArchitecture.ARM64) + { + Log.Verbose(string.Format("Unsupported {0} architecture for v140 toolset", hostArchitecture.ToString())); + return null; + } + else if (hostArchitecture == TargetArchitecture.x64) { string nativeCompilerPath = Path.Combine(vcToolChainDir, "bin", "amd64", "cl.exe"); if (File.Exists(nativeCompilerPath)) @@ -446,12 +451,17 @@ namespace Flax.Build.Platforms Log.Verbose(string.Format("No {0} host compiler toolchain found in {1} or {2}", hostArchitecture.ToString(), nativeCompilerPath, crossCompilerPath)); return null; } - else + else if (hostArchitecture == TargetArchitecture.x86) { string compilerPath = Path.Combine(vcToolChainDir, "bin", "cl.exe"); if (File.Exists(compilerPath)) return Path.GetDirectoryName(compilerPath); - Log.Verbose(string.Format("No {0} host compiler toolchain found in {1}", hostArchitecture.ToString())); + Log.Verbose(string.Format("No {0} host compiler toolchain found in {1}", hostArchitecture.ToString(), compilerPath)); + return null; + } + else + { + Log.Verbose(string.Format("Unsupported {0} host compiler for v140 toolset", hostArchitecture.ToString())); return null; } }