xgrammar: add standalone CMake project for native library (#18611)

Move the ollama_xgrammar target into mlxrunner/xgrammar/native so it
can be configured on its own against an installed xgrammar. cmake/mlx
now adds it as a subdirectory and still uses the pinned xgrammar.
This commit is contained in:
Daniel Hiltgen 2026-09-23 11:20:59 -07:00 • committed by GitHub
parent c173758997
commit b9cd4b1efb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 118 additions and 14 deletions

View file

@ -52,8 +52,6 @@ read_pin() {
tr -d '[:space:]' <"$1"
}
# Native wrapper sources compiled into libollama_xgrammar.dylib — keep in
# sync with the ollama_xgrammar target in cmake/mlx/CMakeLists.txt.
xgrammar_native_dir=mlxrunner/xgrammar/native
# Payload build rules beyond the MLX_VERSION/MLX_C_VERSION pins.