mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 09:46:02 +08:00
[c] Update Rust README.md
This commit is contained in:
parent
aa6b33b626
commit
b25ae0e80d
@ -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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user