Skip to content

Commit 6376e55

Browse files
committed
fix prebuilt on windows, using vendored ninja
1 parent 813df3f commit 6376e55

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

scripts/prebuilt.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var path = require("path");
44
var { sys_extension, is_windows } = require("./config.js");
55

66
var root = path.join(__dirname, "..");
7-
var root_config = { cwd: root, stdio: [0, 1, 2] };
7+
var root_config = { cwd: root, stdio: [0, 1, 2], encoding: 'utf8' };
88
process.env.BS_RELEASE_BUILD = "true";
99

1010
var ocamlVersion = require("./buildocaml.js").getVersionPrefix();
@@ -41,8 +41,11 @@ function buildCompiler() {
4141
});
4242

4343
fs.writeFileSync(path.join(root, "lib", prebuilt), content, "ascii");
44+
process.env.PATH=
45+
`${path.join(__dirname,'..','vendor','ninja','snapshot')}${path.delimiter}${process.env.PATH}`
46+
let ninjaPath = `ninja${sys_extension}`
4447
cp.execSync(
45-
`ninja -C lib -f ${prebuilt} -t clean && ninja -C lib -f ${prebuilt}`,
48+
`${ninjaPath} -C lib -f ${prebuilt} -t clean && ${ninjaPath} -C lib -f ${prebuilt}`,
4649
root_config
4750
);
4851
}

0 commit comments

Comments
 (0)