diff --git a/build.zig b/build.zig index 911dc96..714edbd 100644 --- a/build.zig +++ b/build.zig @@ -316,6 +316,7 @@ pub fn build(b: *std.Build) !void { // output file, so it also needs to be linked with emscripten. exe_lib.linkLibrary(raylib_artifact); const link_step = try emcc.linkWithEmscripten(b, &[_]*std.Build.Step.Compile{ exe_lib, raylib_artifact }); + link_step.addArg("--emrun"); link_step.addArg("--embed-file"); link_step.addArg("resources/"); diff --git a/emcc.zig b/emcc.zig index bbd98e3..5f19860 100644 --- a/emcc.zig +++ b/emcc.zig @@ -120,7 +120,6 @@ pub fn linkWithEmscripten( "-sASYNCIFY", "-O3", "-fsanitize=undefined", - "--emrun", }); return emcc_command; } diff --git a/project_setup.ps1 b/project_setup.ps1 index d2063a4..b56c9e2 100644 --- a/project_setup.ps1 +++ b/project_setup.ps1 @@ -38,6 +38,7 @@ pub fn build(b: *std.Build) !void { // Note that raylib itself is not actually added to the exe_lib output file, so it also needs to be linked with emscripten. const link_step = try rlz.emcc.linkWithEmscripten(b, &[_]*std.Build.Step.Compile{ exe_lib, raylib_artifact }); //this lets your program access files like "resources/my-image.png": + link_step.addArg("--emrun"); link_step.addArg("--embed-file"); link_step.addArg("resources/"); diff --git a/project_setup.sh b/project_setup.sh index bdcb51b..4f58ec2 100755 --- a/project_setup.sh +++ b/project_setup.sh @@ -39,6 +39,7 @@ pub fn build(b: *std.Build) !void { // Note that raylib itself is not actually added to the exe_lib output file, so it also needs to be linked with emscripten. const link_step = try rlz.emcc.linkWithEmscripten(b, &[_]*std.Build.Step.Compile{ exe_lib, raylib_artifact }); //this lets your program access files like "resources/my-image.png": + link_step.addArg("--emrun"); link_step.addArg("--embed-file"); link_step.addArg("resources/");