Skip to content

fix(deps): use system zlib for Assimp on macOS/Linux#11051

Open
BenJule wants to merge 1 commit into
bambulab:masterfrom
BenJule:fix/assimp-macos-bundled-zlib
Open

fix(deps): use system zlib for Assimp on macOS/Linux#11051
BenJule wants to merge 1 commit into
bambulab:masterfrom
BenJule:fix/assimp-macos-bundled-zlib

Conversation

@BenJule
Copy link
Copy Markdown
Contributor

@BenJule BenJule commented Jun 6, 2026

Problem

The dependency build fails on macOS while building Assimp — see the failing run Build All (macos-15, arm64) / Build Deps:

[1/119] Building C object contrib/zlib/CMakeFiles/zlibstatic.dir/zutil.c.o
   22 | int ZEXPORT compress2(dest, destLen, source, sourceLen, level)
error: expected ')'
ninja: build stopped: subcommand failed.

Assimp bundles an old copy of zlib (contrib/zlib) that still uses K&R-style function declarations and an fdopen() macro. These no longer parse against the macOS 15+/26 SDK headers, so ASSIMP_BUILD_ZLIB=ON breaks the macOS dependency build.

Fix

Build Assimp against the system zlib on macOS and Linux (always available there), keeping the bundled copy only on Windows. One-file change, no behavior change on Windows.

Assimp's bundled zlib (contrib/zlib) uses K&R-style function declarations
(e.g. 'int ZEXPORT compress2(dest, destLen, ...)') and an fdopen() macro
that no longer parse against the macOS 15+/26 SDK, breaking the dependency
build on Mac ('Build All (macos-15, arm64) / Build Deps'):

    contrib/zlib/CMakeFiles/zlibstatic.dir/zutil.c.o
    error: expected ')'

Set ASSIMP_BUILD_ZLIB=OFF on macOS and Linux so Assimp links the system
zlib (always available there); keep the bundled copy on Windows.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant