boxddd-sys 0.2.0

Low-level FFI bindings for Box3D built from vendored upstream sources
Documentation
  • Coverage
  • 78.15%
    1323 out of 1693 items documented0 out of 146 items with examples
  • Size
  • Source code size: 2.57 MB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 12.23 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 6s Average build duration of successful builds.
  • all releases: 6s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Latias94/boxddd
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Latias94

boxddd-sys

Low-level Rust FFI for the vendored Box3D C API.

Most users should depend on boxddd instead. Use boxddd-sys directly when you need raw C symbols, custom native linking, or binding-generation maintenance.

Build Contract

Default builds compile the vendored Box3D C sources with the Rust cc crate and link the resulting static library into boxddd-sys.

Normal users need a platform C compiler, such as MSVC Build Tools on Windows, Clang on macOS, or GCC/Clang on Linux. Normal users do not need CMake, LLVM, libclang, or bindgen because checked-in pregenerated bindings are used by default.

Features

  • build-from-source: compile vendored Box3D C sources. Enabled by default.
  • bindgen: allow regenerating bindings when BOXDDD_SYS_FORCE_BINDGEN=1 is set.
  • double-precision: build Box3D with BOX3D_DOUBLE_PRECISION and use matching pregenerated bindings.
  • disable-simd: define BOX3D_DISABLE_SIMD.
  • validate: define BOX3D_VALIDATE.

Native Linking

Disable default features to skip vendored C compilation and link an external box3d library:

boxddd-sys = { version = "0.2", default-features = false }

Optional environment variables:

  • BOXDDD_SYS_LINK_LIB: external library name. Defaults to box3d.
  • BOXDDD_SYS_LINK_SEARCH: native library search directory.

Binding Refresh

Pregenerated bindings are ABI-mode specific. The default build uses bindings_pregenerated.rs; double-precision uses bindings_pregenerated_double.rs.

Regenerate bindings only when maintaining this crate:

BOXDDD_SYS_FORCE_BINDGEN=1 cargo check -p boxddd-sys --features bindgen
BOXDDD_SYS_FORCE_BINDGEN=1 cargo check -p boxddd-sys --features "bindgen double-precision"

WASM

WASM support is early and core-only.

Target Status
wasm32-unknown-unknown Compile-only by default. Provider mode imports Box3D symbols from module box3d-sys-v0.
wasm32-wasip1 Runtime-capable source build when a WASI SDK sysroot is configured.
Browser visual demos Not a boxddd-sys public API contract. The workspace builds Bevy Web examples through provider mode for the demo hub.

Useful environment variables:

  • BOXDDD_SYS_WASM_MODE: compile-only, source, or provider.
  • WASI_SYSROOT: WASI libc sysroot for wasm32-wasip1 source builds.
  • WASI_SDK_PATH: WASI SDK root. Used as $WASI_SDK_PATH/share/wasi-sysroot when WASI_SYSROOT is unset.

Detailed WASM commands live in the workspace documentation: https://github.com/Latias94/boxddd/blob/main/docs/platforms/wasm.md.

Check-Only Builds

BOXDDD_SYS_SKIP_CC=1 skips native C compilation for check-only workflows. Do not use it for normal runnable native builds.

BOXDDD_SYS_SKIP_CC=1 cargo check -p boxddd-sys

License

This crate is licensed as MIT OR Apache-2.0. Vendored Box3D is MIT-licensed.