Fix macOS framework build to properly include headers#964
Merged
Conversation
added 2 commits
February 2, 2026 08:55
The previous implementation using CMake's built-in FRAMEWORK property had two issues: 1. Headers were not copied into the framework at all 2. PUBLIC_HEADER flattens directory structure, breaking C++ interface This replaces the CMake FRAMEWORK support with a custom MacOSFramework cmake module that: - Builds proper framework bundles from scratch - Preserves header directory hierarchy (Audio/, Renderer/ subdirs) - Creates correct symlink structure (Versions/A, Current, etc.) - Generates Info.plist with bundle metadata Also adds CI test script (scripts/test-macos-framework.sh) that validates: - Framework directory structure - Header completeness - Linkability (compile and link test program) Fixes the empty framework issue reported after ef00cfc.
- Add missing Renderer/TextureTypes.hpp to C++ framework headers - Skip pkg-config generation for playlist in framework mode - Use stored framework path property for install instead of TARGET_FILE_DIR - Show compiler errors on linkability test failure instead of suppressing - Fix comment about framework output location
New CI job matrix (build-framework): - Tests framework builds on both arm64 and x86_64 - Tests with and without C++ interface - Runs strict validation after build AND after install - Verifies installed frameworks match build output Test script improvements: - Exhaustive header lists (all C API + all C++ headers) - Exact header count validation (catches stale/unexpected files) - Strict mode (STRICT=1) where SKIPs become FAILs - Info.plist CFBundleExecutable validation - Symlink target verification (Current, Headers, Resources) - Mach-O dylib binary type check - dylib install name validation - Flexible framework search across build tree and install prefix - Test pass counter in summary
kblaschke
approved these changes
Feb 16, 2026
Member
kblaschke
left a comment
There was a problem hiding this comment.
Ahhh, macOS bundles are so much fun! 😆
Still way less code than you need to package a Qt application with CMake, even when using macdeployqt.
That one should be merged and we hopefully don't need to think about it again ;)
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the empty framework issue from ef00cfc where headers weren't being copied into the frameworks.
Turns out CMake's
FRAMEWORKproperty is pretty broken - it requires headers to be added as target sources and set as PUBLIC_HEADER, and even then it flattens everything intoHeaders/losing the directory structure we need for the C++ interface subdirs (Audio/,Renderer/).This PR ditches CMake's framework support and builds the .framework bundles manually with the correct structure.
What's new:
cmake/MacOSFramework.cmake- does the actual framework buildingscripts/test-macos-framework.sh- CI script to validate the frameworks are correctTested locally: