From 9e04f0b05483fdcd80204f68ae87b2bf353a8a42 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Thu, 10 Oct 2024 22:09:03 +0200 Subject: [PATCH] Update Assimp for Linux (use clang 7) --- .../Linux/Binaries/ThirdParty/x64/libIrrXML.a | 3 --- .../Linux/Binaries/ThirdParty/x64/libassimp.a | 4 ++-- .../Tools/Flax.Build/Deps/Dependencies/Assimp.cs | 15 ++++++++++----- 3 files changed, 12 insertions(+), 10 deletions(-) delete mode 100644 Source/Platforms/Linux/Binaries/ThirdParty/x64/libIrrXML.a diff --git a/Source/Platforms/Linux/Binaries/ThirdParty/x64/libIrrXML.a b/Source/Platforms/Linux/Binaries/ThirdParty/x64/libIrrXML.a deleted file mode 100644 index 92c1baf0b..000000000 --- a/Source/Platforms/Linux/Binaries/ThirdParty/x64/libIrrXML.a +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4eb25101716011a5b4c872c5cd303c3292a61e5f661e9296d95502b5705e2e53 -size 181458 diff --git a/Source/Platforms/Linux/Binaries/ThirdParty/x64/libassimp.a b/Source/Platforms/Linux/Binaries/ThirdParty/x64/libassimp.a index 4dccc7f4b..8680fe1af 100644 --- a/Source/Platforms/Linux/Binaries/ThirdParty/x64/libassimp.a +++ b/Source/Platforms/Linux/Binaries/ThirdParty/x64/libassimp.a @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8cbd73a154e270cc03d3da292b2c3cc73ee473b221f43722d060dc114916d6d5 -size 7996212 +oid sha256:fc6f4d94de6fccc854c5ec2cfc98b6516391448f92e9a1ecab6b24709e0c6f87 +size 10378226 diff --git a/Source/Tools/Flax.Build/Deps/Dependencies/Assimp.cs b/Source/Tools/Flax.Build/Deps/Dependencies/Assimp.cs index f5bb8298c..307f0e309 100644 --- a/Source/Tools/Flax.Build/Deps/Dependencies/Assimp.cs +++ b/Source/Tools/Flax.Build/Deps/Dependencies/Assimp.cs @@ -1,6 +1,6 @@ // Copyright (c) 2012-2024 Wojciech Figat. All rights reserved. -using System; +using System.Collections.Generic; using System.IO; using Flax.Build; @@ -122,13 +122,18 @@ namespace Flax.Deps.Dependencies } case TargetPlatform.Linux: { + var envVars = new Dictionary + { + { "CC", "clang-7" }, + { "CC_FOR_BUILD", "clang-7" } + }; + // 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); + RunCmake(root, platform, TargetArchitecture.x64, " -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF " + globalConfig, envVars); + Utilities.Run("make", null, null, root, Utilities.RunOptions.ThrowExceptionOnError, envVars); 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")); break; } case TargetPlatform.Mac: @@ -136,12 +141,12 @@ namespace Flax.Deps.Dependencies // Build for Mac foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 }) { - Utilities.Run("make", "clean", null, root, Utilities.RunOptions.ThrowExceptionOnError); 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.Run("make", "clean", null, root, Utilities.RunOptions.ThrowExceptionOnError); } break; }