Implement platform-specific dependencies

cc #610
It's probably ok to omit the `ref` + `clone()` here (as well as below)