remove emrun from emcc to avoid the game to keep calling stdio.html (#238)

* remove emrun from emcc to avoid the game to keep calling stdio.html

* Remove formater

* Add --emrun for examples and templates
This commit is contained in:
Maicon Santana 2025-06-27 12:24:07 +01:00 committed by GitHub
parent 3bf08a304c
commit 97cb212bf0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 3 additions and 1 deletions

View File

@ -316,6 +316,7 @@ pub fn build(b: *std.Build) !void {
// output file, so it also needs to be linked with emscripten. // output file, so it also needs to be linked with emscripten.
exe_lib.linkLibrary(raylib_artifact); exe_lib.linkLibrary(raylib_artifact);
const link_step = try emcc.linkWithEmscripten(b, &[_]*std.Build.Step.Compile{ exe_lib, 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("--embed-file");
link_step.addArg("resources/"); link_step.addArg("resources/");

View File

@ -120,7 +120,6 @@ pub fn linkWithEmscripten(
"-sASYNCIFY", "-sASYNCIFY",
"-O3", "-O3",
"-fsanitize=undefined", "-fsanitize=undefined",
"--emrun",
}); });
return emcc_command; return emcc_command;
} }

View File

@ -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. // 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 }); 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": //this lets your program access files like "resources/my-image.png":
link_step.addArg("--emrun");
link_step.addArg("--embed-file"); link_step.addArg("--embed-file");
link_step.addArg("resources/"); link_step.addArg("resources/");

View File

@ -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. // 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 }); 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": //this lets your program access files like "resources/my-image.png":
link_step.addArg("--emrun");
link_step.addArg("--embed-file"); link_step.addArg("--embed-file");
link_step.addArg("resources/"); link_step.addArg("resources/");