Skip to content

Commit

Permalink
[WIP] run-wasm helper (cargo-run-wasm) for testing the wgpu runne…
Browse files Browse the repository at this point in the history
…r on the web.
  • Loading branch information
eddyb committed Mar 22, 2023
1 parent 9cd0b27 commit 14a1dae
Show file tree
Hide file tree
Showing 5 changed files with 262 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .cargo/config
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
[alias]
compiletest = "run --release -p compiletests --"
run-wasm = ["run", "--release", "-p", "run-wasm", "--"]

[target.'cfg(target_arch = "wasm32")']
rustflags = ["--cfg=web_sys_unstable_apis"]

[target.'cfg(all())']
rustflags = [
Expand Down
243 changes: 242 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ members = [
"examples/shaders/compute-shader",
"examples/shaders/mouse-shader",
"examples/multibuilder",
"examples/run-wasm",

"crates/rustc_codegen_spirv",
"crates/rustc_codegen_spirv-types",
Expand Down
12 changes: 12 additions & 0 deletions examples/run-wasm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "run-wasm"
description = "cargo-run-wasm helper/wrapper (see cargo-run-wasm docs)"
version = "0.0.0"
publish = false
authors.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true

[dependencies]
cargo-run-wasm = "0.3.0"
3 changes: 3 additions & 0 deletions examples/run-wasm/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
cargo_run_wasm::run_wasm_with_css("body { margin: 0px; }");
}

0 comments on commit 14a1dae

Please sign in to comment.