Remove OS build check for web-sys compatibility

This commit is contained in:
Justin Starry 2020-03-11 23:17:05 +08:00
parent 8afeb03278
commit 3cd7cead79

View File

@ -9,25 +9,8 @@ pub fn main() {
panic!("Yew requires selecting either the `web_sys` or `std_web` cargo feature");
}
let target_os = env::var("CARGO_CFG_TARGET_OS").unwrap_or_default();
let using_wasi = target_os == "wasi";
let using_cargo_web = env::var("COMPILING_UNDER_CARGO_WEB").is_ok();
if using_cargo_web && using_web_sys {
panic!("cargo-web is not compatible with web-sys");
}
let target_arch = env::var("CARGO_CFG_TARGET_ARCH").unwrap_or_default();
let using_wasm_bindgen = target_arch == "wasm32" && !using_cargo_web && !using_wasi;
let using_clippy = env::var("CLIPPY_ARGS").is_ok();
let running_doc_tests = cfg!(feature = "doc_test");
if !using_wasm_bindgen && using_web_sys && !running_doc_tests && !using_clippy {
let target = env::var("TARGET").unwrap_or_default();
panic!(
"Selected target `{}` is not compatible with web-sys",
target
);
}
}