Use no_main to allow xtasks to compile on wasm

This commit is contained in:
Connor Fitzgerald 2025-04-25 18:16:20 -04:00 committed by Andreas Reich
parent fa702f9141
commit 8235cd2932
4 changed files with 8 additions and 2 deletions

View File

@ -5,7 +5,7 @@ edition = "2021"
publish = false
rust-version = "1.84"
[dependencies]
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
anyhow = "1"
env_logger = { version = "0.11.0", default-features = false }
glob = "0.3.1"

View File

@ -1,3 +1,6 @@
#![cfg_attr(target_arch = "wasm32", no_main)]
#![cfg(not(target_arch = "wasm32"))]
use std::process::ExitCode;
use anyhow::Context;

View File

@ -11,7 +11,7 @@ unexpected_cfgs = { level = "warn", check-cfg = [
'cfg(trick_rust_analyzer_into_highlighting_interpolated_bits)',
] }
[dependencies]
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
# The dependencies in this config have no transitive dependencies.
anyhow = "1.0.71"
env_logger = { version = "0.11.0", default-features = false }

View File

@ -1,3 +1,6 @@
#![cfg_attr(target_arch = "wasm32", no_main)]
#![cfg(not(target_arch = "wasm32"))]
use std::process::ExitCode;
use anyhow::Context;