Files
LiveSplitOne/buildCore.js
T
Christopher Serr f81697adfa Activate the WASM Sign Extension Instructions
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.
2021-05-27 00:46:55 +02:00

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"));