create resources folder during project_setup, and link with emscripten

--embed-file complained b/c the directory was empty, so I added
resources/placeholder.txt

I tested project_setup.sh (but not project_setup.ps1) -- the emscripten
build works

also, s/std.builtin.Mode/std.builtin.OptimizeMode
(std.builtin.Mode's source says: "///Deprecated; use OptimizeMode.")
This commit is contained in:
pancelor 2024-09-28 05:55:09 -07:00 committed by GitHub
parent 87e18ab398
commit 6418a87091
Failed to generate hash of commit
3 changed files with 15 additions and 4 deletions

View file

@ -33,6 +33,9 @@ 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("--embed-file");
link_step.addArg("resources/");
b.getInstallStep().dependOn(&link_step.step);
const run_step = try rlz.emcc.emscriptenRunStep(b);
@ -69,4 +72,7 @@ echo '.{
}' >> build.zig.zon
mkdir src
mkdir resources
touch resources/placeholder.txt
cp ../examples/core/basic_window.zig src/main.zig