This commit is contained in:
2024-07-25 22:52:22 +03:00
parent d3c4b5b8c1
commit dcc444173d

View File

@@ -48,7 +48,7 @@ namespace Flax.Deps.Dependencies
public override void Build(BuildOptions options)
{
string root = options.IntermediateFolder;
string configuration = "Debug";//"RelWithDebInfo";
string configuration = "Release";
const bool buildStatic = true;
var configs = new string[]
{
@@ -88,7 +88,6 @@ namespace Flax.Deps.Dependencies
Path.Combine(root, "include", "SDL3"),
};
//SetupDirectory(root, false);
CloneGitRepoFastSince(root, "https://github.com/libsdl-org/SDL.git", new System.DateTime(2024, 7, 15));
GitResetToCommit(root, "ff7a60db85f53c249cbd277915452b4c67323765");
@@ -107,8 +106,6 @@ namespace Flax.Deps.Dependencies
binariesToCopy = new[] { "SDL3-static.lib", };
else
binariesToCopy = new[] { "SDL3.dll", "SDL3.lib", };
//filesToCopy.Add(Path.Combine(buildDir, $"include-config-{configuration.ToLower()}", "build_config"));
directoriesToCopy.Add(Path.Combine(buildDir, "include", "SDL3"));
var solutionPath = Path.Combine(buildDir, "SDL3.sln");
@@ -121,13 +118,11 @@ namespace Flax.Deps.Dependencies
foreach (var file in binariesToCopy)
Utilities.FileCopy(Path.Combine(buildDir, configuration, file), Path.Combine(depsFolder, file == "SDL3-static.lib" ? "SDL3.lib" : file));
}
break;
}
case TargetPlatform.Linux:
{
foreach (var architecture in new TargetArchitecture[] { TargetArchitecture.x64/*, TargetArchitecture.ARM64*/ })
foreach (var architecture in new TargetArchitecture[] { TargetArchitecture.x64 })
{
var buildDir = Path.Combine(root, "build-" + architecture.ToString());
@@ -136,8 +131,6 @@ namespace Flax.Deps.Dependencies
binariesToCopy = new[] { "libSDL3.a" };
else
binariesToCopy = new[] { "libSDL3.so" };
//filesToCopy.Add(Path.Combine(buildDir, $"include-config-{configuration.ToLower()}", "build_config"));
directoriesToCopy.Add(Path.Combine(buildDir, "include", "SDL3"));
int concurrency = Math.Min(Math.Max(1, (int)(Environment.ProcessorCount * Configuration.ConcurrencyProcessorScale)), Configuration.MaxConcurrency);
@@ -149,33 +142,11 @@ namespace Flax.Deps.Dependencies
foreach (var file in binariesToCopy)
Utilities.FileCopy(Path.Combine(buildDir, file), Path.Combine(depsFolder, file));
}
break;
}
case TargetPlatform.Mac:
{
/*var oggRoot = Path.Combine(root, "ogg");
var oggBuildDir = Path.Combine(oggRoot, "build");
var buildDir = Path.Combine(root, "build");
// Get the source
CloneGitRepoFast(root, "https://github.com/xiph/vorbis.git");
CloneGitRepo(oggRoot, "https://github.com/xiph/ogg.git");
GitCheckout(oggRoot, "master", "4380566a44b8d5e85ad511c9c17eb04197863ec5");
// Build for Mac
foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
{
SetupDirectory(oggBuildDir, true);
RunCmake(oggBuildDir, platform, architecture, ".. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=\"../install\"");
Utilities.Run("cmake", "--build . --target install", null, oggBuildDir, Utilities.RunOptions.ConsoleLogOutput);
SetupDirectory(buildDir, true);
RunCmake(buildDir, platform, architecture, string.Format(".. -DCMAKE_BUILD_TYPE=Release -DOGG_INCLUDE_DIR=\"{0}/install/include\" -DOGG_LIBRARY=\"{0}/install/lib\"", oggRoot));
BuildCmake(buildDir);
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
foreach (var file in binariesToCopyUnix)
Utilities.FileCopy(Path.Combine(buildDir, file.SrcFolder, file.Filename), Path.Combine(depsFolder, file.Filename));
}*/
// TODO
break;
}
}