build : use umbrella Headers directory for XCFramework module map#23974
Merged
Conversation
The XCFramework generated by build-xcframework.sh creates a module map
that manually lists public headers.
That list can fall out of sync with the framework's Headers directory.
The module map is currently missing ggml-opt.h, which is present in the
framework headers. This can cause downstream Apple builds to fail with:
Include of non-modular header inside framework module 'llama'
Use the framework's Headers directory itself as the module map umbrella
instead of maintaining a manual header list. This makes all public headers
under the generated framework's Headers directory part of the llama module.
danbev
approved these changes
Jun 2, 2026
ggerganov
approved these changes
Jun 4, 2026
gabe-l-hart
added a commit
to gabe-l-hart/llama.cpp
that referenced
this pull request
Jun 4, 2026
* origin/master: (57 commits) server : disable on-device spec checkpoints (ggml-org#24108) arg: fix double mtp downloads (ggml-org#24128) webui: [a11y] fix keyboard navigation issues in chat interface and sidebar (ggml-org#23132) Move duplicated imatrix code into single common imatrix-loader.cpp (ggml-org#22445) ui: Fixed packages (ggml-org#24119) ui: added single line reasoning preview (ggml-org#23601) return filter to save memory (ggml-org#24125) convert: Fix Gemma 4 Unified conversion (ggml-org#24118) ggml: vectorize ggml_vec_dot_q4_1_q8_1 with WASM SIMD128 (ggml-org#22209) server: avoid unnecessary checkpoint restore when new tokens are present (ggml-org#24110) agents: refactor, include more guidelines (ggml-org#24111) webui: fix tool selector toggle/counter, key tools by stable identity (ggml-org#24065) build : use umbrella Headers directory for XCFramework module map (ggml-org#23974) server : add header to tools/server/server-http.h (ggml-org#24089) cmake: skip cvector-generator and export-lora when CPU backend is disabled (ggml-org#24053) fix(mtmd): handle Gemma 4 audio projector embedding size (ggml-org#24091) readme : add status badges (ggml-org#24104) tests : refactor test-save-load-state to accept token input (ggml-org#24073) metal : reduce rset heartbeat from 500ms -> 5ms (ggml-org#24074) ggml-webgpu: FlashAttention refactor + standardize quantization support (ggml-org#23834) ...
jimbothigpen
pushed a commit
to jimbothigpen/llama.cpp
that referenced
this pull request
Jun 6, 2026
…ml-org#23974) The XCFramework generated by build-xcframework.sh creates a module map that manually lists public headers. That list can fall out of sync with the framework's Headers directory. The module map is currently missing ggml-opt.h, which is present in the framework headers. This can cause downstream Apple builds to fail with: Include of non-modular header inside framework module 'llama' Use the framework's Headers directory itself as the module map umbrella instead of maintaining a manual header list. This makes all public headers under the generated framework's Headers directory part of the llama module. (cherry picked from commit 4d74287)
jimbothigpen
pushed a commit
to jimbothigpen/llama.cpp
that referenced
this pull request
Jun 6, 2026
…ml-org#23974) The XCFramework generated by build-xcframework.sh creates a module map that manually lists public headers. That list can fall out of sync with the framework's Headers directory. The module map is currently missing ggml-opt.h, which is present in the framework headers. This can cause downstream Apple builds to fail with: Include of non-modular header inside framework module 'llama' Use the framework's Headers directory itself as the module map umbrella instead of maintaining a manual header list. This makes all public headers under the generated framework's Headers directory part of the llama module. (cherry picked from commit 4d74287)
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.
Overview
The XCFramework generated by
build-xcframework.shcreates a module map that manually lists public headers.That list can fall out of sync with the framework's
Headersdirectory. The module map is currently missingggml-opt.h, which is present in the framework headers. This can cause downstream Apple builds to fail with:Use the framework's
Headersdirectory itself as the module map umbrella instead of maintaining a manual header list. This makes all public headers under the generated framework'sHeadersdirectory part of thellamamodule.Additional information
The generated
llama.xcframeworkcontains allama.frameworkbundle. Inside that framework, the public headers are copied intollama.framework/Headers, andllama.framework/Modules/module.modulemaptells Clang which of those headers belong to the importablellamamodule.This issue shows up when a downstream Apple build imports the generated framework as a module. In that case, Clang expects headers included by
llama.hto also be declared by the framework's module map. Sinceggml-opt.his present inllama.framework/Headersbut missing frommodule.modulemap, the import can fail as a non-modular include.Projects that build llama.cpp directly from source, or consume the headers without importing the generated framework module, may not hit this error.
Verification:
llama.hincludesggml-opt.h, butggml-opt.hwas not listed in the generated module map.Requirements