Cargo.toml depends on target

I want a cargo.toml with the following property:

if target == wasm32
  include dependency crate Foo
else
  include dependency crate Bar

Is this possible to do in cargo.toml? If so, can you please provide minimal snipplet ?

I think this might be possible with using the [target.'cfg <platform>.dependencies] specification

See docs here

3 Likes