Skip to content

Commit bfcb563

Browse files
committed
fix testbeds in wasm
1 parent e425212 commit bfcb563

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

examples/testbed/2d.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ pub struct Args {
1616
}
1717

1818
fn main() {
19+
#[cfg(not(target_arch = "wasm32"))]
1920
let args: Args = argh::from_env();
21+
#[cfg(target_arch = "wasm32")]
22+
let args: Args = Args::from_args(&[], &[]).unwrap();
2023

2124
let mut app = App::new();
2225
app.add_plugins((DefaultPlugins,))

examples/testbed/3d.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ pub struct Args {
1616
}
1717

1818
fn main() {
19+
#[cfg(not(target_arch = "wasm32"))]
1920
let args: Args = argh::from_env();
21+
#[cfg(target_arch = "wasm32")]
22+
let args: Args = Args::from_args(&[], &[]).unwrap();
2023

2124
let mut app = App::new();
2225
app.add_plugins((DefaultPlugins,))

examples/testbed/ui.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ pub struct Args {
1616
}
1717

1818
fn main() {
19+
#[cfg(not(target_arch = "wasm32"))]
1920
let args: Args = argh::from_env();
21+
#[cfg(target_arch = "wasm32")]
22+
let args: Args = Args::from_args(&[], &[]).unwrap();
2023

2124
let mut app = App::new();
2225
app.add_plugins(DefaultPlugins.set(WindowPlugin {

0 commit comments

Comments
 (0)