From 67fcf4619bfeb8dfd52c0115692a62ec02624cdd Mon Sep 17 00:00:00 2001 From: Shaun Reed Date: Sat, 14 Feb 2026 14:38:34 -0500 Subject: [PATCH] Update assimp to fix Mac CI. Zlib no longer uses fdopen. Zlib previously had redefined fdopen, causing conflicts in apple things. Zlib has since updated to remove these defines, fixing the issue. --- .github/workflows/build.yml | 2 +- CMakeLists.txt | 17 ++++++++++++++++- README.md | 2 +- extern/assimp/assimp | 2 +- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6c38987..0f188bf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,7 +31,7 @@ jobs: cmake: -DCMAKE_PREFIX_PATH=D:/a/qtk/qtk/Qt/$QT_VERSION/mingw81_64/ $CONFIG flags: '' - os: macos-latest - cmake: -DCMAKE_PREFIX_PATH=/home/runner/work/qtk/Qt/$QT_VERSION/gcc_64/ $CONFIG + cmake: -DCMAKE_PREFIX_PATH=/home/runner/work/qtk/Qt/$QT_VERSION/gcc_64/ -Dfdopen=fdopen $CONFIG flags: -j $(nproc) runs-on: ${{ matrix.os }} diff --git a/CMakeLists.txt b/CMakeLists.txt index da5cb99..33b7950 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -157,8 +157,15 @@ list(APPEND VAR_NAMES QT6_INSTALL_PLUGINS) # Find Assimp. if(QTK_SUBMODULES) + if(APPLE) + # Avoid zlib redefining fdopen, causing build failures in apple clang. + # https://github.com/assimp/assimp/issues/6118 + add_compile_definitions(-Dfdopen=fdopen) + endif() + if(NOT WIN32) + add_compile_options(-fPIC) + endif() # Required to statically link. - add_compile_options(-fPIC) set(BUILD_SHARED_LIBS OFF CACHE STRING "Build static assimp libs" FORCE) set(ASSIMP_BUILD_ZLIB ON CACHE STRING "Build Zlib with assimp." FORCE) set( @@ -175,6 +182,14 @@ if(QTK_SUBMODULES) "${CMAKE_CURRENT_SOURCE_DIR}/extern/assimp/assimp/" EXCLUDE_FROM_ALL ) + install( + TARGETS assimp zlibstatic + EXPORT qtk_export + COMPONENT qtk + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin + ) else() find_package(assimp REQUIRED) endif() diff --git a/README.md b/README.md index 41d700e..c884041 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ The Ubuntu apt repositories contain all the packages we need to build all target To build Qtk desktop application with the scene in the screenshots below run the following commands. ```bash -sudo apt update && sudo apt install cmake build-essential git ccache libxkbcommon-dev libassimp-dev qt6-base-dev qt6-tools-dev +sudo apt update && sudo apt install cmake build-essential git ccache libxkbcommon-dev libassimp-dev qt6-base-dev qt6-tools-dev zlib1g-dev cmake -DQTK_GUI_SCENE=ON -B build cmake --build build ./build/bin/qtk_gui diff --git a/extern/assimp/assimp b/extern/assimp/assimp index 5d5496f..e0b5234 160000 --- a/extern/assimp/assimp +++ b/extern/assimp/assimp @@ -1 +1 @@ -Subproject commit 5d5496f1ad895297cede723b3c96b513263f82ed +Subproject commit e0b52347c6e52de2827ec957a9ebf00ce3c54f79