Update deps binaries

#2624
This commit is contained in:
Wojtek Figat
2024-07-24 23:28:48 +02:00
parent dd61d5793c
commit 34d4904b2e
55 changed files with 122 additions and 135 deletions

View File

@@ -91,6 +91,7 @@ namespace Flax.Deps.Dependencies
foreach (var platform in options.Platforms)
{
BuildStarted(platform);
switch (platform)
{
case TargetPlatform.Windows:

View File

@@ -46,6 +46,7 @@ namespace Flax.Deps.Dependencies
foreach (var platform in options.Platforms)
{
BuildStarted(platform);
switch (platform)
{
case TargetPlatform.Windows:

View File

@@ -36,6 +36,7 @@ namespace Flax.Deps.Dependencies
{
foreach (var platform in options.Platforms)
{
BuildStarted(platform);
switch (platform)
{
case TargetPlatform.Windows:

View File

@@ -22,7 +22,6 @@ namespace Flax.Deps.Dependencies
return new[]
{
TargetPlatform.Windows,
TargetPlatform.UWP,
TargetPlatform.XboxOne,
TargetPlatform.XboxScarlett,
};
@@ -48,6 +47,7 @@ namespace Flax.Deps.Dependencies
foreach (var platform in options.Platforms)
{
BuildStarted(platform);
switch (platform)
{
case TargetPlatform.Windows:

View File

@@ -22,7 +22,6 @@ namespace Flax.Deps.Dependencies
return new[]
{
TargetPlatform.Windows,
TargetPlatform.UWP,
TargetPlatform.Linux,
TargetPlatform.XboxOne,
TargetPlatform.XboxScarlett,
@@ -60,6 +59,7 @@ namespace Flax.Deps.Dependencies
Deploy.VCEnvironment.BuildSolution(solutionPath, configuration, buildPlatform);
foreach (var platform in options.Platforms)
{
BuildStarted(platform);
switch (platform)
{
case TargetPlatform.Windows:
@@ -84,6 +84,7 @@ namespace Flax.Deps.Dependencies
Deploy.VCEnvironment.BuildSolution(solutionPath, configuration, buildPlatform);
foreach (var platform in options.Platforms)
{
BuildStarted(platform);
switch (platform)
{
case TargetPlatform.UWP:

View File

@@ -61,6 +61,7 @@ namespace Flax.Deps.Dependencies
foreach (var platform in options.Platforms)
{
BuildStarted(platform);
switch (platform)
{
case TargetPlatform.Windows:

View File

@@ -54,6 +54,7 @@ namespace Flax.Deps.Dependencies
foreach (var platform in options.Platforms)
{
BuildStarted(platform);
switch (platform)
{
case TargetPlatform.Windows:

View File

@@ -384,6 +384,7 @@ namespace Flax.Deps.Dependencies
foreach (var platform in options.Platforms)
{
BuildStarted(platform);
switch (platform)
{
case TargetPlatform.Windows:

View File

@@ -47,6 +47,7 @@ namespace Flax.Deps.Dependencies
foreach (var platform in options.Platforms)
{
BuildStarted(platform);
switch (platform)
{
case TargetPlatform.Windows:

View File

@@ -45,6 +45,7 @@ namespace Flax.Deps.Dependencies
foreach (var platform in options.Platforms)
{
BuildStarted(platform);
switch (platform)
{
case TargetPlatform.Windows:

View File

@@ -69,6 +69,7 @@ namespace Flax.Deps.Dependencies
foreach (var platform in options.Platforms)
{
BuildStarted(platform);
switch (platform)
{
case TargetPlatform.Windows:

View File

@@ -35,6 +35,7 @@ namespace Flax.Deps.Dependencies
{
foreach (var platform in options.Platforms)
{
BuildStarted(platform);
switch (platform)
{
case TargetPlatform.Windows:

View File

@@ -26,7 +26,6 @@ namespace Flax.Deps.Dependencies
return new[]
{
TargetPlatform.Windows,
TargetPlatform.UWP,
TargetPlatform.XboxOne,
TargetPlatform.PS4,
TargetPlatform.PS5,
@@ -50,14 +49,6 @@ namespace Flax.Deps.Dependencies
}
}
private void PatchWindowsTargetPlatformVersion(string vcxprojPath, string vcxprojContents, string windowsTargetPlatformVersion, string platformToolset)
{
// Fix the MSVC project settings for Windows
var contents = vcxprojContents.Replace("$(DefaultPlatformToolset)", string.Format("{0}", platformToolset));
contents = contents.Replace("</TargetName>", string.Format("</TargetName><WindowsTargetPlatformVersion>{0}</WindowsTargetPlatformVersion>", windowsTargetPlatformVersion));
File.WriteAllText(vcxprojPath, contents);
}
/// <inheritdoc />
public override void Build(BuildOptions options)
{
@@ -92,9 +83,18 @@ namespace Flax.Deps.Dependencies
var libraryFileName = "libfreetype.a";
vcxprojContents = vcxprojContents.Replace("<RuntimeLibrary>MultiThreaded</RuntimeLibrary>", "<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>");
vcxprojContents = vcxprojContents.Replace("<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>", "<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>");
vcxprojContents = vcxprojContents.Replace("<<PlatformToolset>v142</PlatformToolset>", "<PlatformToolset>v143</PlatformToolset>");
Utilities.ReplaceInFile(Path.Combine(root, "include", "freetype", "config", "ftoption.h"), "#define FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES", "");
var msvcProps = new Dictionary<string, string>
{
{ "WindowsTargetPlatformVersion", "10.0" },
{ "PlatformToolset", "v143" },
//{ "RuntimeLibrary", "MultiThreadedDLL" }
};
foreach (var platform in options.Platforms)
{
BuildStarted(platform);
switch (platform)
{
case TargetPlatform.Windows:
@@ -105,31 +105,13 @@ namespace Flax.Deps.Dependencies
// Build for Windows
foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
{
Deploy.VCEnvironment.BuildSolution(vsSolutionPath, configurationMsvc, architecture.ToString(),
new Dictionary<string, string>() {
{ "WindowsTargetPlatformVersion", "10.0" },
{ "PlatformToolset", "v143" },
//{ "RuntimeLibrary", "MultiThreadedDLL" }
});
Deploy.VCEnvironment.BuildSolution(vsSolutionPath, configurationMsvc, architecture.ToString(), msvcProps);
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
foreach (var filename in binariesToCopyMsvc)
Utilities.FileCopy(Path.Combine(root, "objs", architecture.ToString(), configurationMsvc, filename), Path.Combine(depsFolder, filename));
}
break;
}
case TargetPlatform.UWP:
{
// Fix the MSVC project settings for UWP
PatchWindowsTargetPlatformVersion(vcxprojPath, vcxprojContents, "10.0.17763.0", "v141");
// Build for UWP x64
Deploy.VCEnvironment.BuildSolution(vsSolutionPath, configurationMsvc, "x64");
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64);
foreach (var filename in binariesToCopyMsvc)
Utilities.FileCopy(Path.Combine(root, "objs", "x64", configurationMsvc, filename), Path.Combine(depsFolder, filename));
break;
}
case TargetPlatform.Linux:
{
var envVars = new Dictionary<string, string>
@@ -198,11 +180,8 @@ namespace Flax.Deps.Dependencies
}
case TargetPlatform.XboxOne:
{
// Fix the MSVC project settings for Xbox One
PatchWindowsTargetPlatformVersion(vcxprojPath, vcxprojContents, "10.0.19041.0", "v142");
// Build for Xbox One x64
Deploy.VCEnvironment.BuildSolution(vsSolutionPath, configurationMsvc, "x64");
Deploy.VCEnvironment.BuildSolution(vsSolutionPath, configurationMsvc, "x64", msvcProps);
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64);
foreach (var filename in binariesToCopyMsvc)
Utilities.FileCopy(Path.Combine(root, "objs", "x64", configurationMsvc, filename), Path.Combine(depsFolder, filename));
@@ -211,11 +190,8 @@ namespace Flax.Deps.Dependencies
}
case TargetPlatform.XboxScarlett:
{
// Fix the MSVC project settings for Xbox Scarlett
PatchWindowsTargetPlatformVersion(vcxprojPath, vcxprojContents, "10.0.19041.0", "v142");
// Build for Xbox Scarlett
Deploy.VCEnvironment.BuildSolution(vsSolutionPath, configurationMsvc, "x64");
Deploy.VCEnvironment.BuildSolution(vsSolutionPath, configurationMsvc, "x64", msvcProps);
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64);
foreach (var filename in binariesToCopyMsvc)
Utilities.FileCopy(Path.Combine(root, "objs", "x64", configurationMsvc, filename), Path.Combine(depsFolder, filename));

View File

@@ -56,6 +56,7 @@ namespace Flax.Deps.Dependencies
foreach (var platform in options.Platforms)
{
BuildStarted(platform);
switch (platform)
{
case TargetPlatform.Windows:

View File

@@ -324,6 +324,7 @@ namespace Flax.Deps.Dependencies
foreach (var platform in options.Platforms)
{
BuildStarted(platform);
var platformData = Path.Combine(GetBinariesFolder(options, platform), "Data", "nethost");
if (Directory.Exists(platformData))
Utilities.DirectoryCopy(platformData, root, true, true);

View File

@@ -26,7 +26,6 @@ namespace Flax.Deps.Dependencies
return new[]
{
TargetPlatform.Windows,
TargetPlatform.UWP,
TargetPlatform.XboxOne,
TargetPlatform.PS4,
TargetPlatform.PS5,
@@ -74,15 +73,18 @@ namespace Flax.Deps.Dependencies
new Binary("libvorbis_static.lib", "libvorbis"),
new Binary("libvorbisfile_static.lib", "libvorbisfile"),
};
private (string, string)[] vorbisBinariesToCopyWindowsCmake =
{
("vorbis.lib", "libvorbis_static.lib"),
("vorbisfile.lib", "libvorbisfile_static.lib"),
};
private Binary[] oggBinariesToCopyWindows =
{
new Binary("libogg_static.lib", "ogg"),
};
private (string, string)[] oggBinariesToCopyWindowsCmake =
{
("ogg.lib", "libogg_static.lib"),
@@ -198,27 +200,6 @@ namespace Flax.Deps.Dependencies
binariesToCopy.AddRange(vorbisBinariesToCopyWindows.Select(x => new Binary(x.Filename, Path.Combine(buildDir, x.SrcFolder, buildPlatform, configurationMsvc))));
break;
}
case TargetPlatform.UWP:
{
buildDir = Path.Combine(rootMsvcLib, "win32", "VS2010");
vcxprojPaths = vcxprojPathsWindows;
PatchWindowsTargetPlatformVersion("10.0.17763.0", "v141");
switch (architecture)
{
case TargetArchitecture.x86:
buildPlatform = "Win32";
break;
case TargetArchitecture.x64:
buildPlatform = "x64";
break;
case TargetArchitecture.ARM:
buildPlatform = "ARM";
break;
default: throw new InvalidArchitectureException(architecture);
}
binariesToCopy.AddRange(vorbisBinariesToCopyWindows.Select(x => new Binary(x.Filename, Path.Combine(buildDir, x.SrcFolder, buildPlatform, configurationMsvc))));
break;
}
case TargetPlatform.PS4:
{
buildDir = Path.Combine(rootMsvcLib, "PS4");
@@ -234,7 +215,7 @@ namespace Flax.Deps.Dependencies
Utilities.DirectoryCopy(Path.Combine(GetBinariesFolder(options, platform), "Data", "vorbis"),
buildDir, true, true);
Utilities.FileCopy(Path.Combine(GetBinariesFolder(options, platform), "Data", "ogg", "ogg", "config_types.h"),
Path.Combine(root, "..", "ogg", "include", "ogg", "config_types.h"));
Path.Combine(root, "libogg", "include", "ogg", "config_types.h"));
binariesToCopy.AddRange(binariesToCopyVorbis.Select(x => new Binary(x.Filename, Path.Combine(buildDir, x.SrcFolder, buildPlatform, configurationMsvc))));
break;
}
@@ -255,7 +236,7 @@ namespace Flax.Deps.Dependencies
buildDir, true, true);
Utilities.FileCopy(
Path.Combine(GetBinariesFolder(options, platform), "Data", "ogg", "ogg", "config_types.h"),
Path.Combine(root, "..", "ogg", "include", "ogg", "config_types.h"));
Path.Combine(root, "libogg", "include", "ogg", "config_types.h"));
binariesToCopy.AddRange(binariesToCopyVorbis.Select(x => new Binary(x.Filename, Path.Combine(buildDir, x.SrcFolder, buildPlatform, configurationMsvc))));
break;
}
@@ -263,14 +244,14 @@ namespace Flax.Deps.Dependencies
buildDir = Path.Combine(rootMsvcLib, "win32", "VS2010");
vcxprojPaths = vcxprojPathsWindows;
buildPlatform = "x64";
PatchWindowsTargetPlatformVersion("10.0.19041.0", "v142");
PatchWindowsTargetPlatformVersion("10.0", "v143");
binariesToCopy.AddRange(vorbisBinariesToCopyWindows.Select(x => new Binary(x.Filename, Path.Combine(buildDir, x.SrcFolder, buildPlatform, configurationMsvc))));
break;
case TargetPlatform.XboxScarlett:
buildDir = Path.Combine(rootMsvcLib, "win32", "VS2010");
vcxprojPaths = vcxprojPathsWindows;
buildPlatform = "x64";
PatchWindowsTargetPlatformVersion("10.0.19041.0", "v142");
PatchWindowsTargetPlatformVersion("10.0", "v143");
binariesToCopy.AddRange(vorbisBinariesToCopyWindows.Select(x => new Binary(x.Filename, Path.Combine(buildDir, x.SrcFolder, buildPlatform, configurationMsvc))));
break;
default: throw new InvalidPlatformException(platform);
@@ -307,11 +288,11 @@ namespace Flax.Deps.Dependencies
case TargetPlatform.Linux:
ext = ".a";
break;
default:
throw new InvalidPlatformException(platform);
default: throw new InvalidPlatformException(platform);
}
List<(string, string)> binariesToCopy = new List<(string, string)>();
var binariesToCopy = new List<(string, string)>();
// Build ogg
{
var solutionPath = Path.Combine(oggBuildDir, "ogg.sln");
@@ -356,6 +337,7 @@ namespace Flax.Deps.Dependencies
foreach (var platform in options.Platforms)
{
BuildStarted(platform);
switch (platform)
{
case TargetPlatform.Windows: