Skip to content

Commit

Permalink
Make nannou package compile in WASM environment
Browse files Browse the repository at this point in the history
  • Loading branch information
Woyten committed Aug 19, 2021
1 parent 1646586 commit 68dc2b4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
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
2 changes: 2 additions & 0 deletions nannou/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ toml = "0.5"
walkdir = "2"
wgpu_upstream = { version = "0.9", package = "wgpu" }
winit = "0.25"
getrandom = "0.2.3"

[features]
default = ["notosans"]
wasm-experimental = ["winit/web-sys", "getrandom/js"]

0 comments on commit 68dc2b4

Please sign in to comment.