[c] Update Rust README.md

This commit is contained in:
Mario Zechner 2025-07-21 03:08:45 +02:00
parent aa6b33b626
commit b25ae0e80d

View File

@ -15,18 +15,21 @@ This test:
## Build Process ## Build Process
The build script compiles: The build script compiles:
- spine-cpp with `-DSPINE_NO_CPPRT` (eliminates C++ standard library) - spine-cpp with no-cpprt variant (eliminates C++ standard library)
- spine-c wrapper (provides C-compatible FFI) - spine-c wrapper (provides C-compatible FFI)
- Generates complete Rust FFI bindings via bindgen from spine-c.h
- Links everything into a single Rust executable/library - Links everything into a single Rust executable/library
spine-c/spine-cpp only rely on libc for `malloc`, `free` and various math function, which can be easily stubbed on any target platform. **Full API Coverage**: Bindgen automatically generates Rust bindings for the entire spine-c API, exposing all public functions without manual FFI maintenance.
spine-c/spine-cpp only rely on libc for `malloc`, `free` and various math functions, which can be easily stubbed on any target platform.
This proves Rust projects can use Spine without C++ stdlib dependencies, enabling WASM compilation via Rust toolchain instead of Emscripten. This proves Rust projects can use Spine without C++ stdlib dependencies, enabling WASM compilation via Rust toolchain instead of Emscripten.
## Files ## Files
- `src/lib.rs` - Rust FFI test calling spine-c functions - `src/lib.rs` - Rust FFI test calling spine-c functions via bindgen-generated bindings
- `build.rs` - Compiles spine-cpp-no-cpprt + spine-c via cc crate - `build.rs` - Compiles spine-cpp-no-cpprt + spine-c via cc crate, generates FFI bindings with bindgen
- Test data: `../../../examples/spineboy/export/spineboy-*` (atlas, skeleton, texture) - Test data: `../../../examples/spineboy/export/spineboy-*` (atlas, skeleton, texture)
## Usage ## Usage