mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-15 03:25:46 -04:00
feat(sled): Print a clear error message when attempting to build on wasm
This commit is contained in:
committed by
Jonas Platte
parent
9714ce9edf
commit
82f4e57a2c
17
crates/matrix-sdk-sled/build.rs
Normal file
17
crates/matrix-sdk-sled/build.rs
Normal file
@@ -0,0 +1,17 @@
|
||||
use std::{env, process};
|
||||
|
||||
fn main() {
|
||||
let target_arch = env::var_os("CARGO_CFG_TARGET_ARCH");
|
||||
if target_arch.map_or(false, |arch| arch == "wasm32") {
|
||||
let err = "this crate does not support the target arch 'wasm32'";
|
||||
eprintln!(
|
||||
"\n\
|
||||
┏━━━━━━━━{pad}━┓\n\
|
||||
┃ error: {err} ┃\n\
|
||||
┗━━━━━━━━{pad}━┛\n\
|
||||
",
|
||||
pad = "━".repeat(err.len()),
|
||||
);
|
||||
process::exit(1);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user