Use bindgen output to generate code #22

Merged
rafaelcaricio merged 3 commits from syn-codegen into master 2020-06-14 09:10:30 +00:00
rafaelcaricio commented 2020-06-14 08:11:29 +00:00 (Migrated from github.com)

This PR implements a better way to generate safe bindings based on syn crate. This uses lvgl-codegen directly, which implements code generation for known patterns. This avoids a lot of manual work to expose LVGL API as safe Rust API.

Improvements:

  • Code generation is completely transparent to users;
  • No (direct) dependency on clang-rs;
  • The code in lvgl-codegen gets cleaner and intuitive to write, since now we are processing Rust code instead of C. C is completely abstracted at the lvgl-sys/rust-bindgen level;
This PR implements a better way to generate safe bindings based on [`syn`](https://docs.rs/syn/1.0.31/syn/index.html) crate. This uses `lvgl-codegen` directly, which implements code generation for known patterns. This avoids a lot of manual work to expose LVGL API as safe Rust API. Improvements: - Code generation is completely transparent to users; - No (direct) dependency on `clang-rs`; - The code in `lvgl-codegen` gets cleaner and intuitive to write, since now we are processing Rust code instead of C. C is completely abstracted at the `lvgl-sys`/`rust-bindgen` level;
Sign in to join this conversation.
No description provided.