Cargo : conditional feature?

Is that something what is possible to get working?

[features]
web = [ "wgpu/webgl", "winit/web-sys" ]
default = []

[target.'cfg( target_arch = "wasm32" )'.features]
default = [ "web" ]

No, the features can't be target specific.

However, you can use target.cfg to add dependencies with other features enabled, or pull in your dependency that enables other features.

1 Like

I see. Thank for answer. Maybe you know, is something like [target.'cfg( target_arch = "wasm32" )'.features] planned?

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.