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

Make nannou package compile in WASM environment #715

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[target.wasm32-unknown-unknown]
rustflags = ["--cfg", "web_sys_unstable_apis"]
6 changes: 6 additions & 0 deletions .github/workflows/nannou.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,17 @@ jobs:
profile: minimal
toolchain: stable
override: true
target: wasm32-unknown-unknown
- name: Run check
uses: actions-rs/cargo@v1
with:
command: check
args: --examples --verbose
- name: Check nannou package builds against wasm32-unknown-unknown
uses: actions-rs/cargo@v1
with:
command: build
args: -p nannou --features wasm-experimental --target wasm32-unknown-unknown

cargo-publish:
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
Expand Down
4 changes: 4 additions & 0 deletions nannou/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ edition = "2018"
[dependencies]
find_folder = "0.3"
futures = { version = "0.3", features = ["executor", "thread-pool"] }
getrandom = "0.2.3"
image = "0.23"
instant = "0.1.9"
lyon = "0.17"
Expand All @@ -36,3 +37,6 @@ winit = "0.26"
default = ["notosans"]
# Enables SPIR-V support in the `wgpu` module.
spirv = ["nannou_wgpu/spirv"]
# Enables experimental WASM compilation for CI-use only
wasm-experimental = ["winit/web-sys", "getrandom/js"]