mirror of
https://github.com/Not-Nik/raylib-zig.git
synced 2025-09-09 12:07:27 +00:00
some final changes
This commit is contained in:
parent
7c6d8da1e9
commit
977d305714
@ -182,8 +182,7 @@ pub fn build(b: *std.Build) !void {
|
|||||||
const link_step = try linkWithEmscripten(b, &[_]*std.Build.Step.Compile{ exe_lib, raylib_artifact });
|
const link_step = try linkWithEmscripten(b, &[_]*std.Build.Step.Compile{ exe_lib, raylib_artifact });
|
||||||
link_step.addArg("--embed-file");
|
link_step.addArg("--embed-file");
|
||||||
link_step.addArg("resources/");
|
link_step.addArg("resources/");
|
||||||
link_step.step.dependOn(&raylib_artifact.step);
|
|
||||||
link_step.step.dependOn(&exe_lib.step);
|
|
||||||
const run_step = try emscriptenRunStep(b);
|
const run_step = try emscriptenRunStep(b);
|
||||||
run_step.step.dependOn(&link_step.step);
|
run_step.step.dependOn(&link_step.step);
|
||||||
const run_option = b.step(ex.name, ex.desc);
|
const run_option = b.step(ex.name, ex.desc);
|
||||||
@ -249,7 +248,6 @@ pub fn compileForEmscripten(b: *std.Build, name: []const u8, root_source_file: [
|
|||||||
// instead of passing every file individually. The entire path given will be the path to read the file within the program.
|
// instead of passing every file individually. The entire path given will be the path to read the file within the program.
|
||||||
// So, if "resources/image.png" is passed, your program will use "resources/image.png" as the path to load the file.
|
// So, if "resources/image.png" is passed, your program will use "resources/image.png" as the path to load the file.
|
||||||
// TODO: test if shared libraries are accepted, I don't remember if emcc can link a shared library with a project or not
|
// TODO: test if shared libraries are accepted, I don't remember if emcc can link a shared library with a project or not
|
||||||
// TODO: add a way to convert from an input path to the output path, if emscripten even allows such a thing.
|
|
||||||
// TODO: add a parameter that allows a custom output directory
|
// TODO: add a parameter that allows a custom output directory
|
||||||
pub fn linkWithEmscripten(b: *std.Build, itemsToLink: []const *std.Build.Step.Compile) !*std.Build.Step.Run {
|
pub fn linkWithEmscripten(b: *std.Build, itemsToLink: []const *std.Build.Step.Compile) !*std.Build.Step.Run {
|
||||||
//Raylib uses --sysroot in order to find emscripten, so do the same here
|
//Raylib uses --sysroot in order to find emscripten, so do the same here
|
||||||
|
@ -26,8 +26,6 @@ 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.
|
||||||
exe_lib.linkLibrary(raylib_artifact);
|
exe_lib.linkLibrary(raylib_artifact);
|
||||||
const link_step = try rl.linkWithEmscripten(b, &[_]*std.Build.Step.Compile{ exe_lib, raylib_artifact });
|
const link_step = try rl.linkWithEmscripten(b, &[_]*std.Build.Step.Compile{ exe_lib, raylib_artifact });
|
||||||
link_step.step.dependOn(&raylib_artifact.step);
|
|
||||||
link_step.step.dependOn(&exe_lib.step);
|
|
||||||
b.getInstallStep().dependOn(&link_step.step);
|
b.getInstallStep().dependOn(&link_step.step);
|
||||||
const run_step = try rl.emscriptenRunStep(b);
|
const run_step = try rl.emscriptenRunStep(b);
|
||||||
run_step.step.dependOn(&link_step.step);
|
run_step.step.dependOn(&link_step.step);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user