Upgrade GDK to 230305 and support v143 MSVC toolset
This commit is contained in:
@@ -73,13 +73,8 @@ namespace Flax.Deps.Dependencies
|
||||
case TargetPlatform.XboxOne:
|
||||
case TargetPlatform.XboxScarlett:
|
||||
{
|
||||
var solutionPath = Path.Combine(root, "DirectXTex_GXDK_2019.sln");
|
||||
File.Copy(Path.Combine(GetBinariesFolder(options, platform), "DirectXTex_GXDK_2019.sln"), solutionPath, true);
|
||||
var projectFileContents = File.ReadAllText(Path.Combine(GetBinariesFolder(options, platform), "DirectXTex_GXDK_2019.vcxproj"));
|
||||
projectFileContents = projectFileContents.Replace("___VS_TOOLSET___", "v142");
|
||||
var projectPath = Path.Combine(root, "DirectXTex", "DirectXTex_GXDK_2019.vcxproj");
|
||||
File.WriteAllText(projectPath, projectFileContents);
|
||||
var binFolder = Path.Combine(root, "DirectXTex", "Bin", "GXDK_2019");
|
||||
var solutionPath = Path.Combine(root, "DirectXTex_GDK_2022.sln");
|
||||
var binFolder = Path.Combine(root, "DirectXTex", "Bin", "GDK_2022");
|
||||
var xboxName = platform == TargetPlatform.XboxOne ? "Gaming.Xbox.XboxOne.x64" : "Gaming.Xbox.Scarlett.x64";
|
||||
Deploy.VCEnvironment.BuildSolution(solutionPath, configuration, xboxName);
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64);
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace Flax.Build.Platforms
|
||||
var versionText = contents.Substring(start, end - start);
|
||||
Version = new Version(int.Parse(versionText), 0);
|
||||
|
||||
var minEdition = 200500;
|
||||
var minEdition = 230305;
|
||||
if (Version.Major < minEdition)
|
||||
{
|
||||
Log.Error(string.Format("Unsupported GDK version {0}. Minimum supported is edition {1}.", Version.Major, minEdition));
|
||||
|
||||
@@ -26,8 +26,9 @@ namespace Flax.Build.Platforms
|
||||
SystemIncludePaths.Add(Path.Combine(GDK.Instance.RootPath, "GRDK\\GameKit\\Include"));
|
||||
SystemLibraryPaths.Add(Path.Combine(GDK.Instance.RootPath, "GRDK\\GameKit\\Lib\\amd64"));
|
||||
var xboxServicesPath = Path.Combine(GDK.Instance.RootPath, "GRDK\\ExtensionLibraries\\Xbox.Services.API.C\\DesignTime\\CommonConfiguration\\Neutral\\");
|
||||
var xboxServicesToolset = Toolset > WindowsPlatformToolset.v142 ? WindowsPlatformToolset.v142 : Toolset;
|
||||
SystemIncludePaths.Add(xboxServicesPath + "Include");
|
||||
SystemLibraryPaths.Add(xboxServicesPath + "Lib\\Release\\" + Toolset);
|
||||
SystemLibraryPaths.Add(xboxServicesPath + "Lib\\Release\\" + xboxServicesToolset);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -42,7 +43,8 @@ namespace Flax.Build.Platforms
|
||||
|
||||
options.LinkEnv.InputLibraries.Add("xgameruntime.lib");
|
||||
options.LinkEnv.InputLibraries.Add("xgameplatform.lib");
|
||||
options.LinkEnv.InputLibraries.Add($"Microsoft.Xbox.Services.{(int)Toolset}.GDK.C.lib");
|
||||
var xboxServicesToolset = Toolset > WindowsPlatformToolset.v142 ? WindowsPlatformToolset.v142 : Toolset;
|
||||
options.LinkEnv.InputLibraries.Add($"Microsoft.Xbox.Services.{(int)xboxServicesToolset}.GDK.C.lib");
|
||||
|
||||
var toolsetPath = WindowsPlatformBase.GetToolsets()[Toolset];
|
||||
var toolsPath = WindowsPlatformBase.GetVCToolPath64(Toolset);
|
||||
@@ -50,7 +52,9 @@ namespace Flax.Build.Platforms
|
||||
throw new Exception("Don't use debug CRT on GDK.");
|
||||
var name = Path.GetFileName(toolsetPath);
|
||||
var redistToolsPath = Path.Combine(toolsPath, "..", "..", "..", "..", "..", "..", "Redist/MSVC/");
|
||||
var paths = Directory.GetDirectories(redistToolsPath, name.Substring(0, 5) + "*");
|
||||
var paths = Directory.GetDirectories(redistToolsPath, name.Substring(0, 2) + "*");
|
||||
if (paths.Length == 0)
|
||||
throw new Exception($"Failed to find MSVC redistribute binaries for toolset '{Toolset}' inside folder '{toolsPath}'");
|
||||
redistToolsPath = Path.Combine(paths[0], "x64", "Microsoft.VC" + (int)Toolset + ".CRT");
|
||||
redistToolsPath = Utilities.RemovePathRelativeParts(redistToolsPath);
|
||||
options.DependencyFiles.Add(Path.Combine(redistToolsPath, "concrt140.dll"));
|
||||
|
||||
Reference in New Issue
Block a user