Skip to content

Commit 8235cd2

Browse files
cwfitzgeraldWumpf
authored andcommitted
Use no_main to allow xtasks to compile on wasm
1 parent fa702f9 commit 8235cd2

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

naga/xtask/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ edition = "2021"
55
publish = false
66
rust-version = "1.84"
77

8-
[dependencies]
8+
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
99
anyhow = "1"
1010
env_logger = { version = "0.11.0", default-features = false }
1111
glob = "0.3.1"

naga/xtask/src/main.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#![cfg_attr(target_arch = "wasm32", no_main)]
2+
#![cfg(not(target_arch = "wasm32"))]
3+
14
use std::process::ExitCode;
25

36
use anyhow::Context;

xtask/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ unexpected_cfgs = { level = "warn", check-cfg = [
1111
'cfg(trick_rust_analyzer_into_highlighting_interpolated_bits)',
1212
] }
1313

14-
[dependencies]
14+
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
1515
# The dependencies in this config have no transitive dependencies.
1616
anyhow = "1.0.71"
1717
env_logger = { version = "0.11.0", default-features = false }

xtask/src/main.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#![cfg_attr(target_arch = "wasm32", no_main)]
2+
#![cfg(not(target_arch = "wasm32"))]
3+
14
use std::process::ExitCode;
25

36
use anyhow::Context;

0 commit comments

Comments
 (0)