Add -dotnet=ver command arg to Flax.Build to specify .NET SDK version to use for build

This commit is contained in:
Wojtek Figat
2023-11-25 12:16:13 +01:00
parent 2cef368282
commit 40d6e18e7e
8 changed files with 91 additions and 20 deletions

View File

@@ -225,10 +225,24 @@ namespace Flax.Build
[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>
/// Specifies the dotnet SDK version to use for the build. Eg. set to '7' to use .NET 7 even if .NET 8 is installed.
/// </summary>
[CommandLine("dotnet", "<ver>", "Specifies the dotnet SDK version to use for the build. Eg. set to '7' to use .NET 7 even if .NET 8 is installed.")]
public static string Dotnet = null;
/// <summary>
/// Custom configuration defines provided via command line for the build tool.
/// </summary>
public static List<string> CustomDefines = new List<string>();
internal static void PassArgs(ref string cmdLine)
{
if (!string.IsNullOrEmpty(Compiler))
cmdLine += " -compiler=" + Compiler;
if (!string.IsNullOrEmpty(Dotnet))
cmdLine += " -dotnet=" + Dotnet;
}
}
/// <summary>