Skip to content

Commit 5aacfd8

Browse files
committed
Various Windows fixes
1 parent d109b67 commit 5aacfd8

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

scripts/buildocaml.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ function build(config) {
5858
if (config) {
5959
var { make } = require("./config.js");
6060
cp.execSync(
61-
'./configure --disable-naked-pointers --enable-flambda -prefix ' +
61+
"bash ./configure --disable-naked-pointers --enable-flambda -prefix " +
6262
prefix +
6363
` && ${make} clean`,
6464
{ cwd: ocamlSrcDir, stdio: [0, 1, 2] }

scripts/ciTest.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ function runTests() {
9393
}
9494
);
9595

96-
cp.execSync(`./test.exe`, { cwd: binDir, stdio: [0, 1, 2] });
96+
cp.execSync(path.join(binDir, 'test.exe'), { cwd: binDir, stdio: [0, 1, 2] });
9797
}
9898

9999
// running generated js tests

scripts/install.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ var my_target =
3030
: process.platform;
3131
var bin_path = path.join(root_dir, my_target);
3232

33+
var ninja_bin_filename = process.platform === "win32" ? "ninja.exe" : "ninja";
3334
var ninja_bin_output = path.join(bin_path, "ninja.exe");
3435

3536
var force_compiler_rebuild = process.argv.includes("-force-compiler-rebuild");
@@ -56,11 +57,11 @@ function provideNinja() {
5657
cwd: ninja_source_dir,
5758
stdio: [0, 1, 2],
5859
});
59-
fs.copyFileSync(path.join(ninja_source_dir, "ninja"), ninja_bin_output);
60+
fs.copyFileSync(path.join(ninja_source_dir, ninja_bin_filename), ninja_bin_output);
6061
} else {
6162
console.log(`ninja.tar.gz not availble in CI mode`);
6263
require("../ninja/snapshot").build();
63-
fs.copyFileSync(path.join(root_dir, "ninja", "ninja"), ninja_bin_output);
64+
fs.copyFileSync(path.join(root_dir, "ninja", ninja_bin_filename), ninja_bin_output);
6465
}
6566

6667
console.log("ninja binary is ready: ", ninja_bin_output);

scripts/ninjaFactory.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ var targetDir = process.platform === 'darwin' && process.arch === 'arm64' ? proc
1919
*/
2020
function libNinja(config) {
2121
return `
22-
ocamlopt = ${config.ocamlopt}
22+
ocamlopt = ${config.ocamlopt}${config.isWin ? ".exe" : ""}
2323
ext = .exe
2424
INCL = ${config.INCL}
2525
flags = -nodynlink -I $INCL -g -w -a ../jscomp/stubs/ext_basic_hash_stubs.c

scripts/prebuilt.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,9 @@ function buildCompiler() {
6161
// delete process.env.OCAMLLIB
6262
var prebuilt = "prebuilt.ninja";
6363
var content = require("./ninjaFactory.js").libNinja({
64-
ocamlopt: is_windows
65-
? `ocamlopt.opt.exe` :
66-
(use_env_compiler ? `ocamlopt.opt`
67-
: `../native/${ocamlVersion}/bin/ocamlopt.opt`),
64+
ocamlopt: use_env_compiler
65+
? `ocamlopt.opt`
66+
: `../native/${ocamlVersion}/bin/ocamlopt.opt`,
6867
INCL: ocamlVersion,
6968
isWin: is_windows,
7069
});

0 commit comments

Comments
 (0)