[package]
name = "boxdd-sys"
version.workspace = true
edition.workspace = true
description = "Low-level FFI bindings for Box2D built from upstream via submodule"
license.workspace = true
repository.workspace = true
homepage.workspace = true
links = "box2d"
build = "build.rs"
readme = "README.md"
documentation = "https://docs.rs/boxdd-sys"
keywords = ["box2d", "physics", "ffi", "bindings", "game"]
categories = ["external-ffi-bindings", "game-engines"]

# Keep the crate slim on crates.io
include = [
    "Cargo.toml",
    "README.md",
    "build.rs",
    "src/**",
    # Internal helper binary used by CI to package prebuilt artifacts.
    "bin/**",
    # Only headers from upstream include/
    "third-party/box2d/include/**/*.h",
    # C sources and local headers from upstream src/
    "third-party/box2d/src/**/*.c",
    "third-party/box2d/src/**/*.h",
    # Upstream license file (Box2D is MIT-licensed)
    "third-party/box2d/LICENSE",
]

[package.metadata.docs.rs]
all-features = false
no-default-features = true
features = []
rustdoc-args = ["--cfg", "docsrs"]

[features]
default = ["build-from-source"]
# Always build vendored Box2D C sources with cc. No prebuilt linking path.
build-from-source = []
pkg-config = ["dep:pkg-config"]
# Enable bindgen-based regeneration of bindings (requires libclang).
bindgen = ["dep:bindgen"]
# Enable the internal `bin/package` helper used by CI to produce prebuilt artifacts.
package-bin = ["dep:flate2", "dep:tar"]
## Optional performance/debug features (match upstream options)
# Enable AVX2 SIMD optimizations (x86_64 only); ignored if `disable-simd` is also set.
simd-avx2 = []
# Disable all SIMD; takes precedence over `simd-avx2`.
disable-simd = []
# Enable heavy internal validation (assertions and checks)
validate = []

[build-dependencies]
cc = { workspace = true }
bindgen = { workspace = true, optional = true }
pkg-config = { workspace = true, optional = true }

[dependencies]
flate2 = { workspace = true, optional = true }
tar = { workspace = true, optional = true }

[[bin]]
name = "package"
path = "bin/package/main.rs"
required-features = ["package-bin"]
