| Crates.io | playdate-bindgen |
| lib.rs | playdate-bindgen |
| version | 0.4.1 |
| created_at | 2023-09-04 13:21:57.003567+00 |
| updated_at | 2025-04-05 18:17:21.345412+00 |
| description | Preconfigured Bindgen with extra codegen for Playdate C-API. |
| homepage | https://github.com/boozook/playdate |
| repository | https://github.com/boozook/playdate.git |
| max_upload_size | |
| id | 963150 |
| size | 77,377 |
Util to generate bindings to Playdate with additional code-gen features like in-code documentation directly by official c-reference.
Rust nightly toolchain
PLAYDATE_SDK_PATH points to the SDK rootFollow the official documentation
arm-none-eabi-gcc or gcc-arm-none-eabi in your PATHRequirements inherited by bindgen, follow official documentation.
Inherited configuration by bindgen: follow bindgen official documentation.
Env var PLAYDATE_SDK_PATH as described in playdate official documentation.
Optional env var ARM_GCC_PATH to help to find arm-none-eabi-gcc (or gcc-arm-none-eabi) with entire toolchain. Useful only for troubleshooting.
Cargo.toml:
[build-dependencies.bindgen]
package = "playdate-bindgen"
version = "*"
Add this to build-dependencies and add to your build-script something like this:
let cfg = bindgen::cfg::Config::default();
let generator = bindgen::Generator::new(cfg).expect("Couldn't create bindings generator.");
let out_path = bindgen::env_var("OUT_DIR").map(PathBuf::from)
.map(|p| p.join(&generator.filename.to_string()))
.unwrap();
let bindings = generator.generate().expect("Couldn't generate bindings.");
bindings.write_to_file(&out_path).expect("Couldn't write bindings.");
For complex examples see build-script in the playdate-sys crate.
This software is not sponsored or supported by Panic.