blazen_ggml_sys/lib.rs
1//! Vendored ggml C library — link-only crate.
2//!
3//! This crate has no Rust API. Its sole purpose is to compile and link a
4//! single canonical copy of `ggml-org/ggml` so that the downstream
5//! `-sys` crates that previously each vendored their own copy can share
6//! one instance. Cargo's `links = "ggml"` attribute on the package
7//! enforces uniqueness in the dependency graph.
8//!
9//! ## Consumers
10//!
11//! - `llama-cpp-sys-2` (via its existing `system-ggml-static` feature)
12//! - `blazen-whisper-sys` (Blazen fork of `whisper-rs-sys` with a
13//! `system-ggml` feature added — patched into the workspace via
14//! `[patch.crates-io]`)
15//! - `blazen-diffusion-sys` (same surgery on `diffusion-rs-sys`)
16//!
17//! ## How consumers find this build
18//!
19//! `build.rs` runs cmake's install step so the artifacts land at
20//! `${OUT_DIR}/install/{lib,include,lib/cmake/ggml}`. We expose:
21//!
22//! - `cargo:include={OUT_DIR}/install/include`
23//! - `cargo:lib={OUT_DIR}/install/lib`
24//! - `cargo:prefix={OUT_DIR}/install`
25//!
26//! Downstream build scripts read these via the cargo-set env vars
27//! `DEP_GGML_INCLUDE`, `DEP_GGML_LIB`, and `DEP_GGML_PREFIX`. Each
28//! consumer passes `CMAKE_PREFIX_PATH=$DEP_GGML_PREFIX` to its own
29//! cmake invocation so its `find_package(ggml REQUIRED)` resolves
30//! against our build instead of fetching/building its own.
31//!
32//! ## License
33//!
34//! Vendored `ggml-org/ggml` source is MIT-licensed; see
35//! `vendor/ggml/LICENSE`.
36
37#![no_std]