Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a feature flag for webgl backend #276

Closed
KaminariOS opened this issue Jun 2, 2022 · 3 comments
Closed

Add a feature flag for webgl backend #276

KaminariOS opened this issue Jun 2, 2022 · 3 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@KaminariOS
Copy link

Currently, if I want to use wasm-pack to build for wasm32, I have to specify

[target.'cfg(target_arch = "wasm32")'.dependencies]
wgpu = { features = ["webgl"]}

The Cargo warns that warning: dependency (wgpu) specified without providing a local path, Git repository, or version to use. This will be considered an error in future versions

To solve this problem, we should add

[features]
web = ["wgpu/webgl"]

to the Cargo.toml of this crate.

@parasyte parasyte added the enhancement New feature or request label Jun 3, 2022
@parasyte
Copy link
Owner

parasyte commented Jun 3, 2022

You can add a dependency on wgpu in your crate, even if it is otherwise unreferenced. I'm not opposed to adding features, though.

@KaminariOS
Copy link
Author

A simple and safe way to do this is to add one line here:

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
pollster = "0.2"
wgpu = { version = "0.12", features = ["webgl"]}

@parasyte parasyte added the good first issue Good for newcomers label Jul 27, 2022
parasyte added a commit that referenced this issue Aug 19, 2022
- The `web` feature was previously exposed by the example crate. This
  isn't really necessary.
- See #276 for discussion
parasyte added a commit that referenced this issue Aug 19, 2022
- The `web` feature was previously exposed by the example crate. This isn't really necessary.
- See #276 for discussion
@parasyte
Copy link
Owner

This was fixed by #320

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants