Update dependencies for Switch
This commit is contained in:
@@ -59,17 +59,11 @@ namespace FlaxEditor.Windows
|
||||
GameCookerWin = win;
|
||||
Selector = platformSelector;
|
||||
|
||||
PerPlatformOptions[PlatformType.Windows].Init("Output/Windows", "Windows");
|
||||
PerPlatformOptions[PlatformType.XboxOne].Init("Output/XboxOne", "XboxOne");
|
||||
PerPlatformOptions[PlatformType.UWP].Init("Output/UWP", "UWP");
|
||||
PerPlatformOptions[PlatformType.Linux].Init("Output/Linux", "Linux");
|
||||
PerPlatformOptions[PlatformType.PS4].Init("Output/PS4", "PS4");
|
||||
PerPlatformOptions[PlatformType.XboxScarlett].Init("Output/XboxScarlett", "XboxScarlett");
|
||||
PerPlatformOptions[PlatformType.Android].Init("Output/Android", "Android");
|
||||
PerPlatformOptions[PlatformType.Switch].Init("Output/Switch", "Switch");
|
||||
PerPlatformOptions[PlatformType.PS5].Init("Output/PS5", "PS5");
|
||||
PerPlatformOptions[PlatformType.Mac].Init("Output/Mac", "Mac");
|
||||
PerPlatformOptions[PlatformType.iOS].Init("Output/iOS", "iOS");
|
||||
foreach (var e in PerPlatformOptions)
|
||||
{
|
||||
var str = e.Key.ToString();
|
||||
e.Value.Init("Output/" + str, str);
|
||||
}
|
||||
}
|
||||
|
||||
[HideInEditor]
|
||||
@@ -201,7 +195,9 @@ namespace FlaxEditor.Windows
|
||||
/// Used to add platform specific tools if available.
|
||||
/// </summary>
|
||||
/// <param name="layout">The layout to start the tools at.</param>
|
||||
public virtual void OnCustomToolsLayout(LayoutElementsContainer layout) { }
|
||||
public virtual void OnCustomToolsLayout(LayoutElementsContainer layout)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void Build()
|
||||
{
|
||||
|
||||
@@ -18,6 +18,9 @@ namespace Flax.Deps.Dependencies
|
||||
/// <seealso cref="Flax.Deps.Dependency" />
|
||||
class mono : Dependency
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override bool BuildByDefault => false; // Unused in favor of nethost
|
||||
|
||||
/// <inheritdoc />
|
||||
public override TargetPlatform[] Platforms
|
||||
{
|
||||
|
||||
@@ -43,9 +43,6 @@ namespace Flax.Deps.Dependencies
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool BuildByDefault => false;
|
||||
|
||||
private string root;
|
||||
private bool cleanArtifacts;
|
||||
|
||||
@@ -296,9 +293,19 @@ namespace Flax.Deps.Dependencies
|
||||
{
|
||||
root = options.IntermediateFolder;
|
||||
|
||||
// On Windows MAX_PATH=260 might cause some build issues with CMake+Ninja, even when LongPathsEnabled=1
|
||||
// To solve this, simply use a drive root folder instead of Deps directory
|
||||
if (BuildPlatform == TargetPlatform.Windows && root.Length > 30)
|
||||
{
|
||||
root = Path.Combine(Path.GetPathRoot(root), "nethost");
|
||||
Log.Info($"Using custom rooted build directory: {root} (due to path size limit)");
|
||||
SetupDirectory(root, false);
|
||||
}
|
||||
|
||||
// Ensure to have dependencies installed
|
||||
Utilities.Run("ninja", "--version", null, null, Utilities.RunOptions.ThrowExceptionOnError);
|
||||
Utilities.Run("cmake", "--version", null, null, Utilities.RunOptions.ThrowExceptionOnError);
|
||||
Utilities.Run("python", "--version", null, null, Utilities.RunOptions.ThrowExceptionOnError);
|
||||
|
||||
// Get the source
|
||||
if (!Directory.Exists(Path.Combine(root, ".git")))
|
||||
|
||||
@@ -428,18 +428,19 @@ namespace Flax.Deps.Dependencies
|
||||
var buildDir = Path.Combine(root, "build");
|
||||
|
||||
// Get the source
|
||||
SetupDirectory(oggRoot, false);
|
||||
CloneGitRepo(root, "https://github.com/xiph/vorbis.git");
|
||||
GitCheckout(root, "master", "98eddc72d36e3421519d54b101c09b57e4d4d10d");
|
||||
CloneGitRepo(oggRoot, "https://github.com/xiph/ogg.git");
|
||||
GitCheckout(oggRoot, "master", "4380566a44b8d5e85ad511c9c17eb04197863ec5");
|
||||
Utilities.DirectoryCopy(Path.Combine(GetBinariesFolder(options, platform), "ogg"), oggRoot, true, true);
|
||||
Utilities.DirectoryCopy(Path.Combine(GetBinariesFolder(options, platform), "vorbis"), buildDir, true, true);
|
||||
Utilities.DirectoryCopy(Path.Combine(GetBinariesFolder(options, platform), "Data/ogg"), oggRoot, true, true);
|
||||
Utilities.DirectoryCopy(Path.Combine(GetBinariesFolder(options, platform), "Data/vorbis"), buildDir, true, true);
|
||||
|
||||
// Build for Switch
|
||||
SetupDirectory(oggBuildDir, true);
|
||||
RunCmake(oggBuildDir, platform, TargetArchitecture.ARM64, ".. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=\"../install\"");
|
||||
Utilities.Run("cmake", "--build . --target install", null, oggBuildDir, Utilities.RunOptions.ConsoleLogOutput);
|
||||
Utilities.FileCopy(Path.Combine(GetBinariesFolder(options, platform), "ogg", "include", "ogg", "config_types.h"), Path.Combine(oggRoot, "install", "include", "ogg", "config_types.h"));
|
||||
Utilities.FileCopy(Path.Combine(GetBinariesFolder(options, platform), "Data/ogg", "include", "ogg", "config_types.h"), Path.Combine(oggRoot, "install", "include", "ogg", "config_types.h"));
|
||||
SetupDirectory(buildDir, true);
|
||||
RunCmake(buildDir, platform, TargetArchitecture.ARM64, string.Format(".. -DCMAKE_BUILD_TYPE=Release -DOGG_INCLUDE_DIR=\"{0}/install/include\" -DOGG_LIBRARY=\"{0}/install/lib\"", oggRoot));
|
||||
BuildCmake(buildDir);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Flax.Build;
|
||||
using Flax.Build.Platforms;
|
||||
using Flax.Build.Projects.VisualStudio;
|
||||
@@ -305,8 +306,12 @@ namespace Flax.Deps
|
||||
cmdLine = "CMakeLists.txt";
|
||||
break;
|
||||
case TargetPlatform.Switch:
|
||||
cmdLine = string.Format("-DCMAKE_TOOLCHAIN_FILE=\"{1}\\Source\\Platforms\\Switch\\Binaries\\Data\\Switch.cmake\" -G \"NMake Makefiles\" -DCMAKE_MAKE_PROGRAM=\"{0}..\\..\\VC\\bin\\nmake.exe\"", Environment.GetEnvironmentVariable("VS140COMNTOOLS"), Globals.EngineRoot);
|
||||
{
|
||||
var nmakeSubdir = "bin\\Hostx64\\x64\\nmake.exe";
|
||||
var toolset = WindowsPlatform.GetToolsets().First(e => File.Exists(Path.Combine(e.Value, nmakeSubdir)));
|
||||
cmdLine = string.Format("-DCMAKE_TOOLCHAIN_FILE=\"{1}\\Source\\Platforms\\Switch\\Binaries\\Data\\Switch.cmake\" -G \"NMake Makefiles\" -DCMAKE_MAKE_PROGRAM=\"{0}\"", Path.Combine(toolset.Value, nmakeSubdir), Globals.EngineRoot);
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.Android:
|
||||
{
|
||||
var ndk = AndroidNdk.Instance.RootPath;
|
||||
|
||||
Reference in New Issue
Block a user