@@ -3,7 +3,7 @@ const std = @import("std");
33
44pub const emsdk_ver_major = "4" ;
55pub const emsdk_ver_minor = "0" ;
6- pub const emsdk_ver_tiny = "3 " ;
6+ pub const emsdk_ver_tiny = "19 " ;
77pub const emsdk_version = emsdk_ver_major ++ "." ++ emsdk_ver_minor ++ "." ++ emsdk_ver_tiny ;
88
99pub fn build (b : * std.Build ) void {
@@ -15,10 +15,7 @@ pub fn emccPath(b: *std.Build) []const u8 {
1515 b .dependency ("emsdk" , .{}).path ("" ).getPath (b ),
1616 "upstream" ,
1717 "emscripten" ,
18- switch (builtin .target .os .tag ) {
19- .windows = > "emcc.bat" ,
20- else = > "emcc" ,
21- },
18+ "emcc.py" ,
2219 }) catch unreachable ;
2320}
2421
@@ -53,7 +50,10 @@ pub fn activateEmsdkStep(b: *std.Build) *std.Build.Step {
5350 },
5451 }) catch unreachable ;
5552
53+ var emsdk_update = b .addSystemCommand (&.{ emsdk_script_path , "update" });
54+
5655 var emsdk_install = b .addSystemCommand (&.{ emsdk_script_path , "install" , emsdk_version });
56+ emsdk_install .step .dependOn (& emsdk_update .step );
5757
5858 switch (builtin .target .os .tag ) {
5959 .linux , .macos = > {
@@ -80,11 +80,11 @@ pub fn activateEmsdkStep(b: *std.Build) *std.Build.Step {
8080
8181 switch (builtin .target .os .tag ) {
8282 .linux , .macos = > {
83- const chmod_emcc = b .addSystemCommand (&.{ "chmod" , "+x" , emccPath (b ) });
83+ const chmod_emcc = b .addSystemCommand (&.{ "chmod" , "a +x" , emccPath (b ) });
8484 chmod_emcc .step .dependOn (& emsdk_activate .step );
8585 step .dependOn (& chmod_emcc .step );
8686
87- const chmod_emrun = b .addSystemCommand (&.{ "chmod" , "+x" , emrunPath (b ) });
87+ const chmod_emrun = b .addSystemCommand (&.{ "chmod" , "a +x" , emrunPath (b ) });
8888 chmod_emrun .step .dependOn (& emsdk_activate .step );
8989 step .dependOn (& chmod_emrun .step );
9090 },
@@ -163,7 +163,6 @@ pub fn emccDefaultSettings(allocator: std.mem.Allocator, options: EmccDefaultSet
163163 },
164164 else = > {},
165165 }
166- settings .put ("USE_OFFSET_CONVERTER" , "1" ) catch unreachable ;
167166 settings .put ("MALLOC" , @tagName (options .emsdk_allocator )) catch unreachable ;
168167 return settings ;
169168}
0 commit comments