Add support for using other VC++ toolset for Window and add cmd arg for selecting compiler manually
This commit is contained in:
@@ -201,6 +201,12 @@ namespace Flax.Build
|
||||
[CommandLine("customProjectFormat", "<type>", "Generates code project files for a custom project format type. Valid only with -genproject option.")]
|
||||
public static string ProjectFormatCustom = null;
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the compiler to use for building. Eg. v140 overrides the toolset when building for Windows.
|
||||
/// </summary>
|
||||
[CommandLine("compiler", "<name>", "Overrides the compiler to use for building. Eg. v140 overrides the toolset when building for Windows.")]
|
||||
public static string Compiler = null;
|
||||
|
||||
/// <summary>
|
||||
/// Custom configuration defines provided via command line for the build tool.
|
||||
/// </summary>
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace Flax.Build.Platforms
|
||||
/// <param name="platform">The platform.</param>
|
||||
/// <param name="architecture">The target architecture.</param>
|
||||
public WindowsToolchain(WindowsPlatform platform, TargetArchitecture architecture)
|
||||
: base(platform, architecture, WindowsPlatformToolset.v140, WindowsPlatformSDK.Latest)
|
||||
: base(platform, architecture, WindowsPlatformToolset.Latest, WindowsPlatformSDK.Latest)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -78,6 +78,13 @@ namespace Flax.Build.Platforms
|
||||
var toolsets = WindowsPlatformBase.GetToolsets();
|
||||
var sdks = WindowsPlatformBase.GetSDKs();
|
||||
|
||||
// Pick the overriden toolset
|
||||
if (Configuration.Compiler != null)
|
||||
{
|
||||
if (Enum.TryParse(Configuration.Compiler, out WindowsPlatformToolset compiler))
|
||||
toolsetVer = compiler;
|
||||
}
|
||||
|
||||
// Pick the newest installed Visual Studio version if using the default toolset
|
||||
if (toolsetVer == WindowsPlatformToolset.Default)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user