Skip to content

Commit 24f18d3

Browse files
Fix build
1 parent 2a3bba1 commit 24f18d3

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
},
1313
"prettier": "@schleifner/prettier-config",
1414
"scripts": {
15-
"build": "node scripts/build_instrumentation.js && tsc --build ./transform/tsconfig.json && tsc --build ./src/tsconfig.json",
15+
"build": "node scripts/build_instrumentation.js -j 2 && tsc --build ./transform/tsconfig.json && tsc --build ./src/tsconfig.json",
1616
"test:as": "node bin/as-test.js",
1717
"test:ts": "cross-env NODE_OPTIONS=--experimental-vm-modules jest",
1818
"test:cpp": "cmake -B build -S . && cmake --build build --parallel --target wasm-instrumentation-test wasm-opt && build/bin/wasm-instrumentation-test",

scripts/build_instrumentation.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ import { existsSync, copyFileSync } from "node:fs";
33

44
const env = process.env;
55

6+
// Parse command-line arguments
7+
const args = process.argv.slice(2);
8+
let parallelJobs = ""; // Default: no value for --parallel
9+
const jIndex = args.indexOf("-j");
10+
if (jIndex !== -1 && args[jIndex + 1]) {
11+
parallelJobs = args[jIndex + 1];
12+
}
13+
614
function initEmscripten() {
715
const sdkPath = "third_party/emsdk/";
816

@@ -17,7 +25,7 @@ function initEmscripten() {
1725
initEmscripten();
1826

1927
execSync("emcmake cmake -B build_wasm -S .", { encoding: "utf8", stdio: "inherit", env });
20-
execSync("cmake --build build_wasm --parallel --target wasm-instrumentation", {
28+
execSync(`cmake --build build_wasm --parallel ${parallelJobs} --target wasm-instrumentation`, {
2129
encoding: "utf8",
2230
stdio: "inherit",
2331
env,

0 commit comments

Comments
 (0)