update examples further and add clarifying comment on addRaygui
This commit is contained in:
parent
5b6f68762b
commit
76a7e5c225
|
|
@ -26,19 +26,19 @@ fn add_module(comptime module: []const u8, b: *std.Build, target: std.Build.Reso
|
||||||
.target = target,
|
.target = target,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
});
|
});
|
||||||
exe.addCSourceFile(.{ .file = .{ .path = path }, .flags = &.{} });
|
exe.addCSourceFile(.{ .file = b.path(path), .flags = &.{} });
|
||||||
exe.linkLibC();
|
exe.linkLibC();
|
||||||
exe.addObjectFile(switch (target.result.os.tag) {
|
exe.addObjectFile(switch (target.result.os.tag) {
|
||||||
.windows => .{ .path = "../zig-out/lib/raylib.lib" },
|
.windows => b.path("../zig-out/lib/raylib.lib"),
|
||||||
.linux => .{ .path = "../zig-out/lib/libraylib.a" },
|
.linux => b.path("../zig-out/lib/libraylib.a"),
|
||||||
.macos => .{ .path = "../zig-out/lib/libraylib.a" },
|
.macos => b.path("../zig-out/lib/libraylib.a"),
|
||||||
.emscripten => .{ .path = "../zig-out/lib/libraylib.a" },
|
.emscripten => b.path("../zig-out/lib/libraylib.a"),
|
||||||
else => @panic("Unsupported OS"),
|
else => @panic("Unsupported OS"),
|
||||||
});
|
});
|
||||||
|
|
||||||
exe.addIncludePath(.{ .path = "../src" });
|
exe.addIncludePath(b.path("../src"));
|
||||||
exe.addIncludePath(.{ .path = "../src/external" });
|
exe.addIncludePath(b.path("../src/external"));
|
||||||
exe.addIncludePath(.{ .path = "../src/external/glfw/include" });
|
exe.addIncludePath(b.path("../src/external/glfw/include"));
|
||||||
|
|
||||||
switch (target.result.os.tag) {
|
switch (target.result.os.tag) {
|
||||||
.windows => {
|
.windows => {
|
||||||
|
|
|
||||||
|
|
@ -211,6 +211,7 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.
|
||||||
return raylib;
|
return raylib;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// This function does not need to be called if you passed .raygui = true to addRaylib
|
||||||
pub fn addRaygui(b: *std.Build, raylib: *std.Build.Step.Compile, raygui_dep: *std.Build.Dependency) void {
|
pub fn addRaygui(b: *std.Build, raylib: *std.Build.Step.Compile, raygui_dep: *std.Build.Dependency) void {
|
||||||
if (raylib_flags_arr.items.len == 0) {
|
if (raylib_flags_arr.items.len == 0) {
|
||||||
@panic(
|
@panic(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user