mirror of
https://github.com/mlua-rs/mlua
synced 2026-06-08 16:05:43 +00:00
Panic when try to build for wasm32 without vendored feature (except luau)
This commit is contained in:
@@ -60,9 +60,6 @@ ffi = { package = "mlua-sys", version = "0.4.0", path = "mlua-sys" }
|
||||
[target.'cfg(unix)'.dependencies]
|
||||
libloading = { version = "0.8", optional = true }
|
||||
|
||||
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
||||
ffi = { package = "mlua-sys", version = "0.4.0", path = "mlua-sys", features = ["vendored"] }
|
||||
|
||||
[dev-dependencies]
|
||||
trybuild = "1.0"
|
||||
futures = "0.3.5"
|
||||
|
||||
@@ -4,6 +4,12 @@ use std::env;
|
||||
use std::ops::Bound;
|
||||
|
||||
pub fn probe_lua() {
|
||||
let target_arch = env::var("CARGO_CFG_TARGET_ARCH").unwrap();
|
||||
|
||||
if target_arch == "wasm32" && cfg!(not(feature = "vendored")) {
|
||||
panic!("Please enable `vendored` feature to build for wasm32");
|
||||
}
|
||||
|
||||
let lib_dir = env::var("LUA_LIB").unwrap_or_default();
|
||||
let lua_lib = env::var("LUA_LIB_NAME").unwrap_or_default();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user