RIOT-OS / rust-riot-wrappers

The `riot-wrappers` crate, which enables high-level access to RIOT from the Rust programming language
13 stars 11 forks source link

build: Use `syn` to pick out constants #49

Closed chrysn closed 11 months ago

chrysn commented 1 year ago

As #48 has shown, picking flags out of the bindgen output is relatively brittle. It worked well for as long as we were only checking for some string's presence, but for CONFIG_ things we need a bit more.

This just uses the syn parser to parse the source code; that's a well established tool that's also used in proc macros.

Leaving this as a draft for a while to gather input and think more about it, but so far I like it.

chrysn commented 11 months ago

Merged after it still builds well with current master and some RIOT/Rust versions in.