Skip to content

Commit 695a376

Browse files
fix(deps): disable Assimp bundled zlib on macOS to fix build with SDK 15+
Assimp 5.4.3's bundled zlib defines `#define fdopen(fd,mode) NULL` in contrib/zlib/zutil.h:147. On macOS 15+ the SDK's `_stdio.h` uses `__DARWIN_ALIAS(fdopen)`, which expands through that macro and causes a C preprocessor parse error, breaking the "Build Deps" CI step on both arm64 and x86_64. Fix: only build the bundled zlib on Windows (where it is needed); on macOS and Linux use the system-provided zlib instead. Fixes the CI failures in #10767. Co-Authored-By: Abdel Gomez-Perez <nabdel07@icloud.com>
1 parent e150b50 commit 695a376

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

deps/Assimp/Assimp.cmake

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
if (WIN32)
2+
set(_assimp_build_zlib ON)
3+
else ()
4+
# On macOS the bundled zlib's fdopen() macro conflicts with the macOS 15+ SDK
5+
# __DARWIN_ALIAS(fdopen) expansion, causing a parse error during dep builds.
6+
# System zlib is always available on macOS/Linux, so disable the bundled copy.
7+
set(_assimp_build_zlib OFF)
8+
endif ()
9+
110
bambustudio_add_cmake_project(Assimp
211
URL "https://github.com/assimp/assimp/archive/refs/tags/v5.4.3.tar.gz"
312
URL_HASH SHA256=66dfbaee288f2bc43172440a55d0235dfc7bf885dda6435c038e8000e79582cb
@@ -11,7 +20,7 @@ bambustudio_add_cmake_project(Assimp
1120
-DASSIMP_BUILD_GLTF_IMPORTER=ON
1221
-DASSIMP_BUILD_OBJ_IMPORTER=ON
1322
-DASSIMP_BUILD_FBX_IMPORTER=ON
14-
-DASSIMP_BUILD_ZLIB=ON
23+
-DASSIMP_BUILD_ZLIB=${_assimp_build_zlib}
1524
-DASSIMP_WARNINGS_AS_ERRORS=OFF
1625
-DBUILD_WITH_STATIC_CRT=OFF
1726
)

0 commit comments

Comments
 (0)