rust-embedded / heapless

Heapless, `static` friendly data structures
Apache License 2.0
1.56k stars 185 forks source link

Depending on platform-specific (arm_llsc) features from a library #516

Open sjorsdewit opened 1 month ago

sjorsdewit commented 1 month ago

I can compile my application (thumbv7em-none-eabihf) directly against heapless and it works fine. But in this case I have a library (e.g. device driver) that depends on heapless and it won't detect the arm_llsc platform correctly.

As a workaround I have copied build.rs into my library. This does work but feels a bit hacky. Is there a cleaner way for a library to depend on features like heapless::pool that require a specific platform such as arm_llsc ?Maybe the arm_llsc detection can be exposed as a helper or separate crate? Or via some feature flag?