mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-10 08:53:00 -04:00
20 lines
1.0 KiB
Rust
20 lines
1.0 KiB
Rust
use std::{env, process};
|
|
|
|
fn main() {
|
|
// Prevent unnecessary rerunning of this build script
|
|
println!("cargo:rerun-if-changed=build.rs");
|
|
|
|
let is_wasm = env::var_os("CARGO_CFG_TARGET_ARCH").is_some_and(|arch| arch == "wasm32");
|
|
if is_wasm && env::var_os("CARGO_FEATURE_JS").is_none() {
|
|
eprintln!(
|
|
"\n\
|
|
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓\n\
|
|
┃ error: matrix-sdk currently requires a JavaScript environment for WASM. ┃\n\
|
|
┃ Please activate the `js` Cargo feature if this is what you want. ┃\n\
|
|
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛\n\
|
|
",
|
|
);
|
|
process::exit(1);
|
|
}
|
|
}
|