refactor: only include OpenThread-relevant bindings#63
Conversation
Instead of blocklisting some specific items, let's just only include any items that start with "ot" or "OT_". This removes a lot of noise from the bindings and also makes them more portable. The only difference between the riscv* and the thumb* bindings is now the different enum representation, so technically we now only need two sets of bindings instead of four.
|
@scootermon Well, I don't care that much because the bindings are anyway under the But if you feel that's important, I don't mind merging that as long as you include in the PR all |
The new libraries are now compiled using clang and the new sysroot.
73b889e to
75d0cbe
Compare
Fair enough. It's mainly a personal pet peeve of mine that -sys crate often don't get the love they deserve :P |
Hm. Then you can send some love to the |
Compared to a lot of other C libraries, OpenThread's headers are very sanitised. They only rely on OpenThread types or on C primitives.
This allows us to specifically only generate bindings for their items, which makes the sys crate much nicer to use.
In fact, the only difference between the different binding files is now "short-enum" vs "normal" enum representation. Even if we add more platforms I expect those will remain the only difference, allowing us to stick with only two pre-generated files.
This is something I would like to look at in a future PR but next up is the mbedtls unification :)
NOTE: I "tested" these changes by compiling the
openthreadcrate for the 4 supported targets. All 4 of them compile without issue.