Conditional compilation by target_os AND feature

I want to put a feature gate to certain capabilities of my crate and remove certain dependencies but some of that dependencies are OS-specific, I know how to filter dependencies by target_os and how to mark them as optional but how do I combine the two things?

You may need to add an extra crate as a layer of indirection.

Make top-level crate have features that enable a "middle" crate, and the "middle" crate to unconditionally pick platform-specific dependencies.

Crates can re-export their dependencies with pub use dependency::*.