twig-sys 2.2.2

FFI bindings and native library for Twig (the Djot/Markdown/HTML/XML document engine). Used by the `twig-doc` crate.
Documentation
[package]
name = "twig-sys"
version.workspace = true
edition.workspace = true
license.workspace = true
description = "FFI bindings and native library for Twig (the Djot/Markdown/HTML/XML document engine). Used by the `twig-doc` crate."
repository = "https://github.com/adammharris/twig"
homepage = "https://github.com/adammharris/twig"
documentation = "https://docs.rs/twig-sys"
readme = "README.md"
keywords = ["djot", "markdown", "ffi", "sys", "bindings"]
categories = ["external-ffi-bindings", "text-processing"]
# `offset_of!` (1.77) + edition 2024 (1.85).
rust-version = "1.85"
# The `links` key belongs to the -sys crate: its build script emits the
# `cargo:rustc-link-lib=static=twig` directive, which propagates to every
# dependent (notably `twig-doc`). Only one crate in the graph may claim it.
links = "twig"

# `include` is an allowlist: only these files are packaged. It deliberately
# carries the vendored `zig/` tree (synced by `vendor-zig.sh` before publish and
# otherwise .gitignore'd) so the published crate builds standalone, without the
# surrounding repo. Keep this in sync with what `build.rs` compiles.
include = [
    "src/**/*.rs",
    "build.rs",
    "README.md",
    "zig/build.zig",
    "zig/build.zig.zon",
    "zig/src/**/*",
    "zig/bindings/c/include/twig.h",
]

[lib]
name = "twig_sys"
path = "src/lib.rs"

# Prebuilt-library payload crates, one per tier-1 target. Each is a
# target-gated dependency: Cargo only activates (and downloads) the one whose
# `cfg` matches the target being built, so a consumer pulls in exactly one
# ~3-5 MB archive. The active payload hands its `libtwig.a` location to
# `build.rs` via `links` metadata (`DEP_TWIG_PREBUILT_<KEY>_LIBDIR`), letting
# `build.rs` link it with no Zig toolchain. Any target NOT covered here (or a
# build that forces it, or fig-style custom native features) falls back to
# compiling the vendored Zig source. Keep this list in sync with
# ../prebuilt-targets.tsv and the `payload_libdir` table in build.rs.
[target.'cfg(all(target_os = "macos", target_arch = "aarch64"))'.dependencies]
twig-sys-macos-arm64 = { workspace = true }

[target.'cfg(all(target_os = "linux", target_arch = "x86_64", target_env = "gnu"))'.dependencies]
twig-sys-linux-x64-gnu = { workspace = true }

[target.'cfg(all(target_os = "linux", target_arch = "aarch64", target_env = "gnu"))'.dependencies]
twig-sys-linux-arm64-gnu = { workspace = true }

[target.'cfg(all(target_os = "windows", target_arch = "x86_64", target_env = "msvc"))'.dependencies]
twig-sys-windows-x64-msvc = { workspace = true }

[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies]
twig-sys-wasm32 = { workspace = true }