Skip to content

Commit abd8433

Browse files
committed
Revert "build.zig: Try adding a wait in activate SDK step on Windows"
This reverts commit dce5c0b.
1 parent dce5c0b commit abd8433

File tree

1 file changed

+7
-22
lines changed

1 file changed

+7
-22
lines changed

build.zig

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
const builtin = @import("builtin");
2-
const host_os = builtin.target.os.tag;
3-
42
const std = @import("std");
53

64
pub const emsdk_ver_major = "4";
@@ -17,7 +15,7 @@ pub fn emccPath(b: *std.Build) []const u8 {
1715
b.dependency("emsdk", .{}).path("").getPath(b),
1816
"upstream",
1917
"emscripten",
20-
switch (host_os) {
18+
switch (builtin.target.os.tag) {
2119
.windows => "emcc.bat",
2220
else => "emcc",
2321
},
@@ -29,7 +27,7 @@ pub fn emrunPath(b: *std.Build) []const u8 {
2927
b.dependency("emsdk", .{}).path("").getPath(b),
3028
"upstream",
3129
"emscripten",
32-
switch (host_os) {
30+
switch (builtin.target.os.tag) {
3331
.windows => "emrun.bat",
3432
else => "emrun",
3533
},
@@ -49,15 +47,15 @@ pub fn htmlPath(b: *std.Build) []const u8 {
4947
pub fn activateEmsdkStep(b: *std.Build) *std.Build.Step {
5048
const emsdk_script_path = std.fs.path.join(b.allocator, &.{
5149
b.dependency("emsdk", .{}).path("").getPath(b),
52-
switch (host_os) {
50+
switch (builtin.target.os.tag) {
5351
.windows => "emsdk.bat",
5452
else => "emsdk",
5553
},
5654
}) catch unreachable;
5755

5856
var emsdk_install = b.addSystemCommand(&.{ emsdk_script_path, "install", emsdk_version });
5957

60-
switch (host_os) {
58+
switch (builtin.target.os.tag) {
6159
.linux, .macos => {
6260
emsdk_install.step.dependOn(&b.addSystemCommand(&.{ "chmod", "+x", emsdk_script_path }).step);
6361
},
@@ -80,7 +78,7 @@ pub fn activateEmsdkStep(b: *std.Build) *std.Build.Step {
8078
}.make,
8179
});
8280

83-
switch (host_os) {
81+
switch (builtin.target.os.tag) {
8482
.linux, .macos => {
8583
const chmod_emcc = b.addSystemCommand(&.{ "chmod", "+x", emccPath(b) });
8684
chmod_emcc.step.dependOn(&emsdk_activate.step);
@@ -91,25 +89,12 @@ pub fn activateEmsdkStep(b: *std.Build) *std.Build.Step {
9189
step.dependOn(&chmod_emrun.step);
9290
},
9391
.windows => {
94-
const windows_wait_step = b.allocator.create(std.Build.Step) catch unreachable;
95-
windows_wait_step.* = std.Build.Step.init(.{
96-
.id = .custom,
97-
.name = "Wait for a sceond",
98-
.owner = b,
99-
.makeFn = &struct {
100-
fn make(_: *std.Build.Step, _: std.Build.Step.MakeOptions) anyerror!void {
101-
std.time.sleep(std.time.ns_per_s * 1);
102-
}
103-
}.make,
104-
});
105-
windows_wait_step.dependOn(&emsdk_activate.step);
106-
10792
const takeown_emcc = b.addSystemCommand(&.{ "takeown", "/f", emccPath(b) });
108-
takeown_emcc.step.dependOn(windows_wait_step);
93+
takeown_emcc.step.dependOn(&emsdk_activate.step);
10994
step.dependOn(&takeown_emcc.step);
11095

11196
const takeown_emrun = b.addSystemCommand(&.{ "takeown", "/f", emrunPath(b) });
112-
takeown_emrun.step.dependOn(windows_wait_step);
97+
takeown_emrun.step.dependOn(&emsdk_activate.step);
11398
step.dependOn(&takeown_emrun.step);
11499
},
115100
else => {},

0 commit comments

Comments
 (0)