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

@@ -160,6 +160,9 @@ bool DeployDataStep::Perform(CookingData& data)
}
else
{
#if 1
failed |= EditorUtilities::CopyDirectoryIfNewer(dstDotnet / TEXT("host/fxr") / version, srcDotnet / TEXT("host/fxr") / version, true);
#else
// TODO: hostfxr for target platform should be copied from nuget package location: microsoft.netcore.app.runtime.<RID>/<VERSION>/runtimes/<RID>/native/hostfxr.dll
String dstHostfxr = dstDotnet / TEXT("host/fxr") / version;
if (!FileSystem::DirectoryExists(dstHostfxr))
@@ -174,6 +177,7 @@ bool DeployDataStep::Perform(CookingData& data)
failed |= FileSystem::CopyFile(dstHostfxr / TEXT("hostfxr.dylib"), depsRoot / TEXT("ThirdParty") / archName / TEXT("hostfxr.dylib"));
else
failed |= true;
#endif
failed |= EditorUtilities::CopyDirectoryIfNewer(dstDotnet / TEXT("shared/Microsoft.NETCore.App") / version, srcDotnet / TEXT("shared/Microsoft.NETCore.App") / version, true);
}
if (failed)

Binary file not shown.

View File

@@ -109,7 +109,7 @@ FT_BEGIN_HEADER
* ```
*
*/
#define FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
/**************************************************************************

View File

@@ -153,7 +153,7 @@
#define ft_strtol strtol
#define ft_getenv getenv
char* ft_getenv(const char* n);
/**************************************************************************

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:

View File

@@ -62,6 +62,15 @@ namespace Flax.Deps
/// <param name="options">The options.</param>
public abstract void Build(BuildOptions options);
/// <summary>
/// Logs build process start.
/// </summary>
/// <param name="platform">Target platform.</param>
protected void BuildStarted(TargetPlatform platform)
{
Log.Info($"Building {GetType().Name} for {platform}");
}
/// <summary>
/// Gets the dependency third-party packages binaries folder.
/// </summary>