[package]
authors.workspace = true
categories = ["api-bindings", "external-ffi-bindings"]
description = "Raw FFI bindings for the Lean 4 C ABI. See `lean-rs` for the safe front door."
documentation = "https://docs.rs/lean-rs-sys"
edition.workspace = true
include = ["Cargo.toml", "LICENSE-APACHE", "LICENSE-MIT", "README.md", "build.rs", "src/**/*.rs", "tests/**/*.rs"]
keywords = ["bindings", "ffi", "lean", "lean4", "sys"]
license.workspace = true
links = "leanshared"
name = "lean-rs-sys"
readme = "README.md"
repository.workspace = true
rust-version.workspace = true
version.workspace = true

[features]
# Default: dynamic linking against `libleanshared.dylib`. The static feature
# is also available but selecting it requires extending the link set beyond
# what `lean.h` requires (notably `libStd.a` and an appropriate link order);
# see `build.rs` for the details.
default = ["dynamic", "mimalloc"]
dynamic = []
# Deprecated compatibility marker. Metadata-only consumers should depend on
# `lean-rs-abi` or `lean-toolchain`; this crate remains the raw FFI/link crate.
metadata-only = []
mimalloc = []
static = []

[dependencies]
lean-rs-abi = { workspace = true }

[build-dependencies]
# The build script reads `SUPPORTED_TOOLCHAINS` to match the local `lean.h`
# digest against the supported window. `lean-rs-abi` is link-free, so depending
# on it here pulls in no Lean runtime; it must be a real build-dependency (not a
# cross-crate source include) so the published `lean-rs-sys` tarball builds
# standalone on crates.io / docs.rs.
lean-rs-abi = { workspace = true }
sha2 = { workspace = true }

[dev-dependencies]
# Drives the `tests/compile_fail/*.rs` negative cases from
# `tests/compile_fail_surface.rs`; gated behind `RUN_TRYBUILD=1` so the
# OS/rustc-sensitive `.stderr` snapshots run only in the pinned CI job.
trybuild = "1"

[lints]
workspace = true

[lib]
doctest = false

[package.metadata.docs.rs]
default-target = "x86_64-unknown-linux-gnu"
targets = []

# `tests/compile_fail/*.rs` are driven by trybuild from
# `tests/compile_fail_surface.rs` via string-based `t.compile_fail(...)` calls,
# which cargo-shear cannot see statically.
[package.metadata.cargo-shear]
ignored-paths = ["tests/compile_fail/*.rs"]
