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 whenBOXDDD_SYS_FORCE_BINDGEN=1is set.double-precision: build Box3D withBOX3D_DOUBLE_PRECISIONand use matching pregenerated bindings.disable-simd: defineBOX3D_DISABLE_SIMD.validate: defineBOX3D_VALIDATE.
Native Linking
Disable default features to skip vendored C compilation and link an external box3d library:
= { = "0.2", = false }
Optional environment variables:
BOXDDD_SYS_LINK_LIB: external library name. Defaults tobox3d.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
BOXDDD_SYS_FORCE_BINDGEN=1
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, orprovider.WASI_SYSROOT: WASI libc sysroot forwasm32-wasip1source builds.WASI_SDK_PATH: WASI SDK root. Used as$WASI_SDK_PATH/share/wasi-sysrootwhenWASI_SYSROOTis 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
License
This crate is licensed as MIT OR Apache-2.0. Vendored Box3D is MIT-licensed.