Skip setup of ARM64 configuration for Windows with no compiler support
This commit is contained in:
@@ -125,9 +125,7 @@ namespace Flax.Build
|
|||||||
continue;
|
continue;
|
||||||
if (!platform.HasRequiredSDKsInstalled && (!projectInfo.IsCSharpOnlyProject || platform != Platform.BuildPlatform))
|
if (!platform.HasRequiredSDKsInstalled && (!projectInfo.IsCSharpOnlyProject || platform != Platform.BuildPlatform))
|
||||||
continue;
|
continue;
|
||||||
|
if (!platform.CanBuildArchitecture(architecture))
|
||||||
// Prevent generating configuration data for Windows x86
|
|
||||||
if (architecture == TargetArchitecture.x86 && targetPlatform == TargetPlatform.Windows)
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
string configurationText = targetName + '.' + platformName + '.' + configurationName;
|
string configurationText = targetName + '.' + platformName + '.' + configurationName;
|
||||||
|
|||||||
@@ -188,6 +188,16 @@ namespace Flax.Build
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Determines whether this platform can compile or cross-compile for the specified architecture.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="targetArchitecture">The architecture.</param>
|
||||||
|
/// <returns><c>true</c> if this platform can build the specified architecture; otherwise, <c>false</c>.</returns>
|
||||||
|
public virtual bool CanBuildArchitecture(TargetArchitecture targetArchitecture)
|
||||||
|
{
|
||||||
|
return IsPlatformSupported(Target, targetArchitecture);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the path to the output file for the linker.
|
/// Gets the path to the output file for the linker.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -70,6 +70,24 @@ namespace Flax.Build.Platforms
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override bool CanBuildArchitecture(TargetArchitecture targetArchitecture)
|
||||||
|
{
|
||||||
|
// Prevent generating configuration data for Windows x86 (deprecated)
|
||||||
|
if (targetArchitecture == TargetArchitecture.x86)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Check if we have a compiler for this architecture
|
||||||
|
var toolsets = GetToolsets();
|
||||||
|
foreach (var toolset in toolsets)
|
||||||
|
{
|
||||||
|
if (GetVCToolPath(toolset.Key, BuildTargetArchitecture, targetArchitecture) != null)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
void IVisualStudioProjectCustomizer.WriteVisualStudioBegin(VisualStudioProject project, Platform platform, StringBuilder vcProjectFileContent, StringBuilder vcFiltersFileContent, StringBuilder vcUserFileContent)
|
void IVisualStudioProjectCustomizer.WriteVisualStudioBegin(VisualStudioProject project, Platform platform, StringBuilder vcProjectFileContent, StringBuilder vcFiltersFileContent, StringBuilder vcUserFileContent)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -424,53 +424,48 @@ namespace Flax.Build.Platforms
|
|||||||
|
|
||||||
switch (toolset)
|
switch (toolset)
|
||||||
{
|
{
|
||||||
case WindowsPlatformToolset.v140:
|
case WindowsPlatformToolset.v140:
|
||||||
|
{
|
||||||
|
if (hostArchitecture != TargetArchitecture.x86)
|
||||||
{
|
{
|
||||||
if (hostArchitecture != TargetArchitecture.x86)
|
string nativeCompilerPath = Path.Combine(vcToolChainDir, "bin", "amd64", "cl.exe");
|
||||||
{
|
|
||||||
string nativeCompilerPath = Path.Combine(vcToolChainDir, "bin", "amd64", "cl.exe");
|
|
||||||
if (File.Exists(nativeCompilerPath))
|
|
||||||
{
|
|
||||||
return Path.GetDirectoryName(nativeCompilerPath);
|
|
||||||
}
|
|
||||||
|
|
||||||
string crossCompilerPath = Path.Combine(vcToolChainDir, "bin", "x86_amd64", "cl.exe");
|
|
||||||
if (File.Exists(crossCompilerPath))
|
|
||||||
{
|
|
||||||
return Path.GetDirectoryName(crossCompilerPath);
|
|
||||||
}
|
|
||||||
throw new Exception(string.Format("No {0} host compiler toolchain found in {1} or {2}", hostArchitecture.ToString(), nativeCompilerPath, crossCompilerPath));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
string compilerPath = Path.Combine(vcToolChainDir, "bin", "cl.exe");
|
|
||||||
if (File.Exists(compilerPath))
|
|
||||||
{
|
|
||||||
return Path.GetDirectoryName(compilerPath);
|
|
||||||
}
|
|
||||||
throw new Exception(string.Format("No {0} host compiler toolchain found in {1}", hostArchitecture.ToString()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
case WindowsPlatformToolset.v141:
|
|
||||||
case WindowsPlatformToolset.v142:
|
|
||||||
case WindowsPlatformToolset.v143:
|
|
||||||
case WindowsPlatformToolset.v144:
|
|
||||||
{
|
|
||||||
string hostFolder = hostArchitecture == TargetArchitecture.x86 ? "HostX86" : $"Host{hostArchitecture.ToString().ToLower()}";
|
|
||||||
string nativeCompilerPath = Path.Combine(vcToolChainDir, "bin", hostFolder, architecture.ToString().ToLower(), "cl.exe");
|
|
||||||
if (File.Exists(nativeCompilerPath))
|
if (File.Exists(nativeCompilerPath))
|
||||||
{
|
|
||||||
return Path.GetDirectoryName(nativeCompilerPath);
|
return Path.GetDirectoryName(nativeCompilerPath);
|
||||||
}
|
|
||||||
|
|
||||||
string crossCompilerPath = Path.Combine(vcToolChainDir, "bin", hostFolder, architecture.ToString().ToLower(), "cl.exe");
|
string crossCompilerPath = Path.Combine(vcToolChainDir, "bin", "x86_amd64", "cl.exe");
|
||||||
if (File.Exists(crossCompilerPath))
|
if (File.Exists(crossCompilerPath))
|
||||||
{
|
|
||||||
return Path.GetDirectoryName(crossCompilerPath);
|
return Path.GetDirectoryName(crossCompilerPath);
|
||||||
}
|
|
||||||
throw new Exception(string.Format("No {0} host compiler toolchain found in {1} or {2}", hostArchitecture.ToString(), nativeCompilerPath, crossCompilerPath));
|
Log.Verbose(string.Format("No {0} host compiler toolchain found in {1} or {2}", hostArchitecture.ToString(), nativeCompilerPath, crossCompilerPath));
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
default: throw new ArgumentOutOfRangeException(nameof(toolset), toolset, null);
|
else
|
||||||
|
{
|
||||||
|
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()));
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case WindowsPlatformToolset.v141:
|
||||||
|
case WindowsPlatformToolset.v142:
|
||||||
|
case WindowsPlatformToolset.v143:
|
||||||
|
case WindowsPlatformToolset.v144:
|
||||||
|
{
|
||||||
|
string hostFolder = hostArchitecture == TargetArchitecture.x86 ? "HostX86" : $"Host{hostArchitecture.ToString().ToLower()}";
|
||||||
|
string nativeCompilerPath = Path.Combine(vcToolChainDir, "bin", hostFolder, architecture.ToString().ToLower(), "cl.exe");
|
||||||
|
if (File.Exists(nativeCompilerPath))
|
||||||
|
return Path.GetDirectoryName(nativeCompilerPath);
|
||||||
|
|
||||||
|
string crossCompilerPath = Path.Combine(vcToolChainDir, "bin", hostFolder, architecture.ToString().ToLower(), "cl.exe");
|
||||||
|
if (File.Exists(crossCompilerPath))
|
||||||
|
return Path.GetDirectoryName(crossCompilerPath);
|
||||||
|
|
||||||
|
Log.Verbose(string.Format("No {0} host compiler toolchain found in {1} or {2}", hostArchitecture.ToString(), nativeCompilerPath, crossCompilerPath));
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
default: throw new ArgumentOutOfRangeException(nameof(toolset), toolset, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -136,6 +136,8 @@ namespace Flax.Build.Platforms
|
|||||||
// Get the tools paths
|
// Get the tools paths
|
||||||
var hostArchitecture = Platform.BuildTargetArchitecture;
|
var hostArchitecture = Platform.BuildTargetArchitecture;
|
||||||
_vcToolPath = WindowsPlatformBase.GetVCToolPath(Toolset, hostArchitecture, Architecture);
|
_vcToolPath = WindowsPlatformBase.GetVCToolPath(Toolset, hostArchitecture, Architecture);
|
||||||
|
if (string.IsNullOrEmpty(_vcToolPath))
|
||||||
|
throw new Exception(string.Format("No {0} host compiler tools found for target architecture {1}", hostArchitecture, Architecture));
|
||||||
_compilerPath = Path.Combine(_vcToolPath, "cl.exe");
|
_compilerPath = Path.Combine(_vcToolPath, "cl.exe");
|
||||||
_linkerPath = Path.Combine(_vcToolPath, "link.exe");
|
_linkerPath = Path.Combine(_vcToolPath, "link.exe");
|
||||||
_libToolPath = Path.Combine(_vcToolPath, "lib.exe");
|
_libToolPath = Path.Combine(_vcToolPath, "lib.exe");
|
||||||
|
|||||||
Reference in New Issue
Block a user