Skip to content

fix: opt in clang-cl for ARM ggml - #20

Merged
gabewillen merged 1 commit into
mainfrom
fix/ggml-clangcl-fetch
Aug 7, 2026
Merged

fix: opt in clang-cl for ARM ggml#20
gabewillen merged 1 commit into
mainfrom
fix/ggml-clangcl-fetch

Conversation

@gabewillen

Copy link
Copy Markdown
Contributor

Windows ARM64 with clang-cl reports MSVC compatibility to ggml's ARM guard. Add an explicit OFF-by-default CORTEXT_ALLOW_CLANGCL_ARM option and a narrowly scoped exact/idempotent patch to fetched ggml v0.9.5 before add_subdirectory when opted in. Missing or ambiguous guard text fails configure; default behavior remains unchanged.

Copilot AI lite review requested due to automatic review settings August 7, 2026 08:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds an explicit, OFF-by-default CMake opt-in intended to support Windows ARM64 builds where clang-cl is detected as MSVC by ggml’s ARM guard, by patching the fetched ggml v0.9.5 source before add_subdirectory() is invoked.

Changes:

  • Introduces CORTEXT_ALLOW_CLANGCL_ARM CMake option (default OFF) to gate any behavior change.
  • Adds cortext_patch_fetched_ggml_arm_guard() to apply a narrowly-scoped, exact/idempotent patch to ggml’s ARM compiler guard.
  • Wires the patch into the ggml FetchContent path immediately before adding ggml as a subdirectory.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread CMakeLists.txt
Comment on lines +414 to +417
set(_cortext_ggml_arm_guard_old
[=[if (MSVC AND NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")]=])
set(_cortext_ggml_arm_guard_new
[=[if (MSVC AND NOT CMAKE_C_COMPILER_ID STREQUAL "Clang" AND NOT CORTEXT_ALLOW_CLANGCL_ARM)]=])
@gabewillen
gabewillen merged commit e0a9615 into main Aug 7, 2026
13 checks passed
@gabewillen
gabewillen deleted the fix/ggml-clangcl-fetch branch August 7, 2026 08:48
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.

2 participants