7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 1 | use std::{env, process}; |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 2 | |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 3 | fn main() { |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 4 | // Prevent unnecessary rerunning of this build script |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 5 | println!("cargo:rerun-if-changed=build.rs"); |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 6 | |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 7 | let is_wasm = env::var_os("CARGO_CFG_TARGET_ARCH").is_some_and(|arch| arch == "wasm32"); |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 8 | if is_wasm && env::var_os("CARGO_FEATURE_JS").is_none() { |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 9 | eprintln!( |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 10 | "\n\ |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 11 | ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓\n\ |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 12 | ┃ error: matrix-sdk currently requires a JavaScript environment for WASM. ┃\n\ |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 13 | ┃ Please activate the `js` Cargo feature if this is what you want. ┃\n\ |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 14 | ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛\n\ |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 15 | ", |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 16 | ); |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 17 | process::exit(1); |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 18 | } |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 19 | } |