mirror of
https://github.com/ApfelTeeSaft/LiveSplitOne.git
synced 2026-08-27 19:19:42 +00:00
All browsers now support the new WebAssembly Sign Extension Instructions which improve code that casts around between small integer types. We'd like to activate a bunch more new WASM instructions, but Safari is really lacking behind quite a lot. Even just activating these requires the latest Safari / iOS version that came out just a month ago. We notify the user to update their browser / iOS version in case they have an outdated browser. iOS updates on its own over night, so I believe most people should be on the latest version and shouldn't have any problem updating in case it didn't happpen yet.
34 lines
792 B
JavaScript
34 lines
792 B
JavaScript
const { execSync } = require("child_process");
|
|
const fs = require("fs");
|
|
|
|
execSync(
|
|
"cargo run",
|
|
{
|
|
cwd: "livesplit-core/capi/bind_gen",
|
|
stdio: "inherit",
|
|
},
|
|
);
|
|
|
|
execSync(
|
|
"cargo build -p cdylib --features wasm-web --target wasm32-unknown-unknown --release",
|
|
{
|
|
cwd: "livesplit-core",
|
|
stdio: "inherit",
|
|
env: {
|
|
...process.env,
|
|
'RUSTFLAGS': '-C target-feature=+sign-ext',
|
|
},
|
|
},
|
|
);
|
|
|
|
execSync(
|
|
"wasm-bindgen livesplit-core/target/wasm32-unknown-unknown/release/livesplit_core.wasm --out-dir src/livesplit-core",
|
|
{
|
|
stdio: "inherit",
|
|
},
|
|
);
|
|
|
|
fs
|
|
.createReadStream("livesplit-core/capi/bindings/wasm_bindgen/index.ts")
|
|
.pipe(fs.createWriteStream("src/livesplit-core/index.ts"));
|