Update AssImp to latest version

This commit is contained in:
2024-06-21 21:55:30 +03:00
parent 0d8691045b
commit 6436fb3bde
97 changed files with 8626 additions and 4181 deletions

View File

@@ -44,6 +44,7 @@ namespace Flax.Deps.Dependencies
{
var root = options.IntermediateFolder;
var moduleFilename = "assimp.Build.cs";
string configHeaderFilePath = null;
var configs = new string[]
{
"-DASSIMP_NO_EXPORT=ON",
@@ -86,8 +87,8 @@ namespace Flax.Deps.Dependencies
var globalConfig = string.Join(" ", configs);
// Get the source
CloneGitRepo(root, "https://github.com/FlaxEngine/assimp.git");
GitCheckout(root, "master", "5c900d689a5db5637b98f665fc1e9e9c9ed416b9");
CloneGitRepoFast(root, "https://github.com/assimp/assimp.git");
GitCheckout(root, "master", "adff2f388a23f2192738470b094bb3197feb8ada");
foreach (var platform in options.Platforms)
{
@@ -95,22 +96,27 @@ namespace Flax.Deps.Dependencies
{
case TargetPlatform.Windows:
{
var solutionPath = Path.Combine(root, "Assimp.sln");
var configuration = "Release";
var binariesWin = new[]
{
Path.Combine(root, "bin", configuration, "assimp-vc140-md.dll"),
Path.Combine(root, "lib", configuration, "assimp-vc140-md.lib"),
Path.Combine("bin", configuration, "assimp-vc140-md.dll"),
Path.Combine("lib", configuration, "assimp-vc140-md.lib"),
};
// Build for Win64
// Build for Windows
File.Delete(Path.Combine(root, "CMakeCache.txt"));
RunCmake(root, platform, TargetArchitecture.x64);
Deploy.VCEnvironment.BuildSolution(solutionPath, configuration, "x64");
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64);
foreach (var file in binariesWin)
foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
{
Utilities.FileCopy(file, Path.Combine(depsFolder, Path.GetFileName(file)));
var buildDir = Path.Combine(root, "build-" + architecture.ToString());
var solutionPath = Path.Combine(buildDir, "Assimp.sln");
SetupDirectory(buildDir, true);
RunCmake(root, platform, architecture, $"-B\"{buildDir}\" -DLIBRARY_SUFFIX=-vc140-md -DUSE_STATIC_CRT=OFF " + globalConfig);
Deploy.VCEnvironment.BuildSolution(solutionPath, configuration, architecture.ToString());
configHeaderFilePath = Path.Combine(buildDir, "include", "assimp", "config.h");
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
foreach (var file in binariesWin)
Utilities.FileCopy(Path.Combine(buildDir, file), Path.Combine(depsFolder, Path.GetFileName(file)));
}
break;
@@ -120,6 +126,7 @@ namespace Flax.Deps.Dependencies
// Build for Linux
RunCmake(root, platform, TargetArchitecture.x64, " -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF " + globalConfig);
Utilities.Run("make", null, null, root, Utilities.RunOptions.ThrowExceptionOnError);
configHeaderFilePath = Path.Combine(root, "include", "assimp", "config.h");
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64);
Utilities.FileCopy(Path.Combine(root, "lib", "libassimp.a"), Path.Combine(depsFolder, "libassimp.a"));
Utilities.FileCopy(Path.Combine(root, "lib", "libIrrXML.a"), Path.Combine(depsFolder, "libIrrXML.a"));
@@ -132,6 +139,7 @@ namespace Flax.Deps.Dependencies
{
RunCmake(root, platform, architecture, " -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF " + globalConfig);
Utilities.Run("make", null, null, root, Utilities.RunOptions.ThrowExceptionOnError);
configHeaderFilePath = Path.Combine(root, "include", "assimp", "config.h");
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
Utilities.FileCopy(Path.Combine(root, "lib", "libassimp.a"), Path.Combine(depsFolder, "libassimp.a"));
Utilities.FileCopy(Path.Combine(root, "lib", "libIrrXML.a"), Path.Combine(depsFolder, "libIrrXML.a"));
@@ -151,6 +159,7 @@ namespace Flax.Deps.Dependencies
Utilities.FileCopy(moduleFileBackup, moduleFile);
Utilities.DirectoryCopy(srcIncludePath, dstIncludePath, true, true);
Utilities.FileCopy(Path.Combine(root, "LICENSE"), Path.Combine(dstIncludePath, "LICENSE"));
Utilities.FileCopy(configHeaderFilePath, Path.Combine(dstIncludePath, "config.h"));
}
}
}