diff --git a/.github/workflows/build_osx.yml b/.github/workflows/build_osx.yml index b4de5e2e8c..f76964506e 100644 --- a/.github/workflows/build_osx.yml +++ b/.github/workflows/build_osx.yml @@ -88,10 +88,15 @@ jobs: # actually drops ifcopenshell.document.rdb.dylib into # site-packages/ifcopenshell/ (see the commit that added this # gate for the full history + the rocksdb/macdeployqt write-up). + # --shared mirrors build_rocky.yml after 27249770e: builds + # IfcOpenShell as shared libs so each plug-in dylib references + # libIfcParse / libIfcGeom via @rpath instead of statically + # embedding them — the dominant size win for BonsaiViewer.app + # (per-plugin libs go from ~30-50 MB to a few MB). CXXFLAGS="-O3" CFLAGS="-O3 ${DARWIN_C_SOURCE}" ADD_COMMIT_SHA=1 BUILD_CFG=Release \ BUILD_BONSAIVIEWER=ON QT_DIR="${QT_DIR}" \ IFCOS_BUILD_PYTHON_WRAPPER=off \ - python3 ./nix/build-all.py -v --diskcleanup ${MAC_INTEL} \ + python3 ./nix/build-all.py -v --diskcleanup --shared ${MAC_INTEL} \ | tee build.log - name: Upload Build Logs diff --git a/src/bonsaiviewer/CMakeLists.txt b/src/bonsaiviewer/CMakeLists.txt index 179eee2a2e..0dac4dd59d 100644 --- a/src/bonsaiviewer/CMakeLists.txt +++ b/src/bonsaiviewer/CMakeLists.txt @@ -180,6 +180,13 @@ if(APPLE) install(CODE [[ file(GLOB _ifc_plugins "${CMAKE_INSTALL_PREFIX}/lib/ifcopenshell.*.dylib") + # Skip ifcopenshell.geometry.writer.*.dylib — those are heavy + # schema-specific OBJ / glTF / DAE / STP / IGS / SVG / TTL export + # converters. BonsaiViewer is a viewer; it never writes geometry + # out, so they're pure deadweight. Mirrors the Rocky workflow's + # filter in `stage_runtime_payload` (see 27249770e). Cuts the + # macOS .app by ~100-150 MB. + list(FILTER _ifc_plugins EXCLUDE REGEX "ifcopenshell\\.geometry\\.writer\\.") if(_ifc_plugins) message(STATUS "Staging IfcOpenShell plug-ins into BonsaiViewer.app/Contents/Frameworks") file(COPY ${_ifc_plugins}