@@ -13,7 +13,8 @@ pub fn build(b: *std.Build) void {
1313pub fn emccPath (b : * std.Build ) []const u8 {
1414 return std .fs .path .join (b .allocator , &.{
1515 b .dependency ("emsdk" , .{}).path ("" ).getPath (b ),
16- "upstream/emscripten/" ,
16+ "upstream" ,
17+ "emscripten" ,
1718 switch (builtin .target .os .tag ) {
1819 .windows = > "emcc.bat" ,
1920 else = > "emcc" ,
@@ -24,7 +25,8 @@ pub fn emccPath(b: *std.Build) []const u8 {
2425pub fn emrunPath (b : * std.Build ) []const u8 {
2526 return std .fs .path .join (b .allocator , &.{
2627 b .dependency ("emsdk" , .{}).path ("" ).getPath (b ),
27- "upstream/emscripten/" ,
28+ "upstream" ,
29+ "emscripten" ,
2830 switch (builtin .target .os .tag ) {
2931 .windows = > "emrun.bat" ,
3032 else = > "emrun" ,
@@ -35,7 +37,10 @@ pub fn emrunPath(b: *std.Build) []const u8 {
3537pub fn htmlPath (b : * std.Build ) []const u8 {
3638 return std .fs .path .join (b .allocator , &.{
3739 b .dependency ("emsdk" , .{}).path ("" ).getPath (b ),
38- "upstream/emscripten/src/shell.html" ,
40+ "upstream" ,
41+ "emscripten" ,
42+ "src" ,
43+ "shell.html" ,
3944 }) catch unreachable ;
4045}
4146
@@ -54,6 +59,9 @@ pub fn activateEmsdkStep(b: *std.Build) *std.Build.Step {
5459 .linux , .macos = > {
5560 emsdk_install .step .dependOn (& b .addSystemCommand (&.{ "chmod" , "+x" , emsdk_script_path }).step );
5661 },
62+ .windows = > {
63+ emsdk_install .step .dependOn (& b .addSystemCommand (&.{ "takeown" , "/f" , emsdk_script_path }).step );
64+ },
5765 else = > {},
5866 }
5967
@@ -74,13 +82,21 @@ pub fn activateEmsdkStep(b: *std.Build) *std.Build.Step {
7482 .linux , .macos = > {
7583 const chmod_emcc = b .addSystemCommand (&.{ "chmod" , "+x" , emccPath (b ) });
7684 chmod_emcc .step .dependOn (& emsdk_activate .step );
85+ step .dependOn (& chmod_emcc .step );
7786
7887 const chmod_emrun = b .addSystemCommand (&.{ "chmod" , "+x" , emrunPath (b ) });
7988 chmod_emrun .step .dependOn (& emsdk_activate .step );
80-
81- step .dependOn (& chmod_emcc .step );
8289 step .dependOn (& chmod_emrun .step );
8390 },
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+ },
84100 else = > {},
85101 }
86102
0 commit comments