add argument to Pkg().link to enable linking to system raylib
This commit is contained in:
parent
c6222a0913
commit
6ece4e99f0
2 changed files with 12 additions and 3 deletions
|
|
@ -58,13 +58,15 @@ pub fn build(b: *Builder) void {
|
|||
};
|
||||
|
||||
const examples_step = b.step("examples", "Builds all the examples");
|
||||
const system_lib = b.option(bool, "system-raylib", "link to preinstalled raylib libraries") orelse false;
|
||||
|
||||
for (examples) |ex| {
|
||||
const exe = b.addExecutable(ex.name, ex.path);
|
||||
|
||||
exe.setBuildMode(mode);
|
||||
exe.setTarget(target);
|
||||
|
||||
raylib.link(exe);
|
||||
raylib.link(exe, system_lib);
|
||||
raylib.addAsPackage("raylib", exe);
|
||||
raylib.math.addAsPackage("raylib-math", exe);
|
||||
|
||||
|
|
@ -73,4 +75,4 @@ pub fn build(b: *Builder) void {
|
|||
run_step.dependOn(&run_cmd.step);
|
||||
examples_step.dependOn(&exe.step);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue