Skip to content

Commit

Permalink
run-wasm helper (cargo-run-wasm) for testing the wgpu runner on t…
Browse files Browse the repository at this point in the history
…he web.
  • Loading branch information
eddyb committed Apr 15, 2023
1 parent 788c801 commit bef7bf0
Show file tree
Hide file tree
Showing 6 changed files with 266 additions and 3 deletions.
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
248 changes: 245 additions & 3 deletions 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
1 change: 1 addition & 0 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ skip-tree = [
{ name = "example-runner-ash", version = "0.0.0", depth = 20 },
{ name = "example-runner-cpu", version = "0.0.0", depth = 20 },
{ name = "example-runner-wgpu", version = "0.0.0", depth = 20 },
{ name = "run-wasm", version = "0.0.0", depth = 20 },
{ name = "compiletests", version = "0.0.0", depth = 20 },
{ name = "compiletests-deps-helper", version = "0.0.0", depth = 20 },
]
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.2"
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 bef7bf0

Please sign in to comment.