[emcc] Fix build for Windows (#86)
Co-authored-by: DanielKMach <danikoucher@gmail.com>
This commit is contained in:
parent
f5abffe4f7
commit
a420751c0d
1 changed files with 4 additions and 1 deletions
5
emcc.zig
5
emcc.zig
|
|
@ -92,7 +92,10 @@ pub fn linkWithEmscripten(
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create the output directory because emcc can't do it.
|
// Create the output directory because emcc can't do it.
|
||||||
const mkdir_command = b.addSystemCommand(&[_][]const u8{ "mkdir", "-p", emccOutputDir });
|
const mkdir_command = switch (builtin.os.tag) {
|
||||||
|
.windows => b.addSystemCommand(&.{ "cmd.exe", "/c", "if", "not", "exist", emccOutputDir, "mkdir", emccOutputDir }),
|
||||||
|
else => b.addSystemCommand(&.{ "mkdir", "-p", emccOutputDir }),
|
||||||
|
};
|
||||||
|
|
||||||
// Actually link everything together.
|
// Actually link everything together.
|
||||||
const emcc_command = b.addSystemCommand(&[_][]const u8{emcc_run_arg});
|
const emcc_command = b.addSystemCommand(&[_][]const u8{emcc_run_arg});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue