From 45bd9eeb76e9d6f60bc6c0851e8818943ba49c5f Mon Sep 17 00:00:00 2001 From: Mohcine Chraibi Date: Tue, 11 Aug 2026 11:07:32 +0200 Subject: [PATCH] Fix macOS superbuild for Apple Silicon toolchains Three failures prevented the Assimp superbuild step from completing on macOS. All fixes are scoped to the elseif(APPLE) branch; Windows and Linux behaviour is unchanged. - Assimp 5.4.3 predates AppleClang's -Wnontrivial-memcall, which its own -Werror escalates to a hard failure in SceneCombiner.cpp. Disable ASSIMP_WARNINGS_AS_ERRORS. - pkg-config resolved minizip to an x86_64 Homebrew prefix, which cannot link against the arm64 build. Use the bundled contrib/unzip instead. - The staging step chose its source directory with a configure-time EXISTS check against a path Assimp only creates during install, so a clean tree always fell back to lib/ and staged a nested Mac/ folder. CMAKE_INSTALL_LIBDIR is already forced to lib/Mac, so the check was redundant. Verified by a full superbuild plus a successful ProjectMobiusEditor Mac Development build against UE 5.5.4. --- UnrealFolder/ProjectMobius/CMakeLists.txt | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/UnrealFolder/ProjectMobius/CMakeLists.txt b/UnrealFolder/ProjectMobius/CMakeLists.txt index d1b3f2e9c..80cd75ac9 100644 --- a/UnrealFolder/ProjectMobius/CMakeLists.txt +++ b/UnrealFolder/ProjectMobius/CMakeLists.txt @@ -119,6 +119,15 @@ elseif(APPLE) -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 + # Assimp 5.4.3 predates AppleClang's -Wnontrivial-memcall, which its own + # -Werror then turns into a hard failure in SceneCombiner.cpp. + -DASSIMP_WARNINGS_AS_ERRORS=OFF + + # Use the bundled contrib/unzip rather than pkg-config's minizip, which on a + # machine with an Intel Homebrew prefix resolves to an x86_64 library and + # fails to link against this arm64 build. + -DASSIMP_BUILD_MINIZIP=ON + # Assimp on UNIX derives ASSIMP_LIB_INSTALL_DIR from CMAKE_INSTALL_LIBDIR. # Force libs into lib/Mac to match UE_Assimp expectations. -DCMAKE_INSTALL_LIBDIR=lib/Mac @@ -171,13 +180,10 @@ if(WIN32) COMMENT "Staging Assimp DLLs to ${ASSIMP_STAGE_DIR}" ) elseif(APPLE) - # Assimp 5.x layouts differ a bit between versions. - # Prefer lib/Mac if it exists (old layout), otherwise fall back to lib/. - if(EXISTS "${ASSIMP_INST}/lib/Mac") - set(ASSIMP_MAC_LIB_DIR "${ASSIMP_INST}/lib/Mac") - else() - set(ASSIMP_MAC_LIB_DIR "${ASSIMP_INST}/lib") - endif() + # CMAKE_INSTALL_LIBDIR is forced to lib/Mac above, so the layout is known. + # An EXISTS check here would run at configure time, before Assimp is installed, + # and on a clean tree would fall back to lib/ and stage a nested Mac/ folder. + set(ASSIMP_MAC_LIB_DIR "${ASSIMP_INST}/lib/Mac") add_custom_command(TARGET assimp_stage POST_BUILD COMMAND ${CMAKE_COMMAND} -E rm -rf "${ASSIMP_STAGE_DIR}"