Skip to content

Commit d2d1261

Browse files
committed
Windows takeown emsdk executables
1 parent ffbb234 commit d2d1261

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

build.zig

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ pub fn activateEmsdkStep(b: *std.Build) *std.Build.Step {
5959
.linux, .macos => {
6060
emsdk_install.step.dependOn(&b.addSystemCommand(&.{ "chmod", "+x", emsdk_script_path }).step);
6161
},
62+
.windows => {
63+
emsdk_install.step.dependOn(&b.addSystemCommand(&.{ "takeown", "/f", emsdk_script_path }).step);
64+
},
6265
else => {},
6366
}
6467

@@ -79,13 +82,21 @@ pub fn activateEmsdkStep(b: *std.Build) *std.Build.Step {
7982
.linux, .macos => {
8083
const chmod_emcc = b.addSystemCommand(&.{ "chmod", "+x", emccPath(b) });
8184
chmod_emcc.step.dependOn(&emsdk_activate.step);
85+
step.dependOn(&chmod_emcc.step);
8286

8387
const chmod_emrun = b.addSystemCommand(&.{ "chmod", "+x", emrunPath(b) });
8488
chmod_emrun.step.dependOn(&emsdk_activate.step);
85-
86-
step.dependOn(&chmod_emcc.step);
8789
step.dependOn(&chmod_emrun.step);
8890
},
91+
.windows => {
92+
const takeown_emcc = b.addSystemCommand(&.{ "takeown", "/f", emccPath(b) });
93+
takeown_emcc.step.dependOn(&emsdk_activate.step);
94+
step.dependOn(&takeown_emcc.step);
95+
96+
const takeown_emrun = b.addSystemCommand(&.{ "takeown", "/f", emrunPath(b) });
97+
takeown_emrun.step.dependOn(&emsdk_activate.step);
98+
step.dependOn(&takeown_emrun.step);
99+
},
89100
else => {},
90101
}
91102

0 commit comments

Comments
 (0)