[package]
name = "blazen-ggml-sys"
version.workspace = true
edition.workspace = true
license.workspace = true
authors.workspace = true
rust-version.workspace = true
repository.workspace = true
description = "Vendored ggml C library, built once and reused by Blazen's whisper-rs-sys / llama-cpp-sys-2 / diffusion-rs-sys consumers via patch.crates-io."
links = "ggml"

# The vendored ggml tree at `vendor/ggml/` is upstream `ggml-org/ggml` pinned
# to the commit shipped with `llama-cpp-sys-2 0.1.146` (the most actively
# maintained downstream). Cargo's `links = "ggml"` attribute enforces a
# single copy in the dep graph — the three -sys crates that previously
# triple-vendored their own ggml are patched (via the workspace
# `[patch.crates-io]` block) to compile against this one instead, killing
# the `-Wl,--allow-multiple-definition` band-aid the Go cgo link relies on.

[lib]
# `links =` requires a real lib; rlib is the cheapest path. No public Rust
# surface — consumers go through the upstream `-sys` crates' bindings.
crate-type = ["rlib"]

[features]
# CPU-only by default; vendors all the CPU SIMD kernels.
default = []
# Build with -march=native (host-tuned). Off by default for portability.
native = []
# Metal backend — Apple-only. On non-Apple targets the build.rs ignores
# this feature even when active, so `cargo build --all-features` on
# Linux/Windows is a no-op rather than a hard cmake failure.
metal = []
# NOTE: cuda / hip / vulkan backends are intentionally NOT exposed
# here as cargo features. Activating them via `--all-features` on a
# host without the matching toolchain (nvcc / HIP runtime / Vulkan
# SDK) triggers hard cmake errors that block CI on every platform we
# care about. Until the workspace has a way to mark these as
# platform-gated, the shared blazen-ggml-sys is CPU+Metal only.
# Consumer crates (llama-cpp-sys-2, whisper-rs-sys, diffusion-rs-sys)
# remain free to enable cuda/hip/vulkan in their OWN cmake builds;
# those paths just won't dedupe against this crate today. Follow-up:
# add gated GPU-backend cargo features here that detect the toolchain
# in build.rs before emitting the cmake `GGML_<BACKEND>=ON` flag.

[build-dependencies]
cmake = "0.1"

[lints]
workspace = true
