Fix weird sdl linkage build.zig

This commit is contained in:
haxsam 2026-04-17 20:58:01 +02:00
parent cd4c816453
commit b2a84f732e
No known key found for this signature in database

View File

@ -658,17 +658,6 @@ fn addExamples(
var dir = try b.build_root.handle.openDir(b.graph.io, module_subpath, .{ .iterate = true });
defer dir.close(b.graph.io);
if (platform == .sdl) {
raylib.root_module.linkSystemLibrary("SDL2", .{});
raylib.root_module.linkSystemLibrary("SDL3", .{});
}
if (platform == .sdl2) {
raylib.root_module.linkSystemLibrary("SDL2", .{});
}
if (platform == .sdl3) {
raylib.root_module.linkSystemLibrary("SDL3", .{});
}
var iter = dir.iterate();
while (try iter.next(b.graph.io)) |entry| {
if (entry.kind != .file) continue;
@ -687,6 +676,17 @@ fn addExamples(
exe_mod.addCSourceFile(.{ .file = b.path(path) });
exe_mod.linkLibrary(raylib);
if (platform == .sdl) {
exe_mod.linkSystemLibrary("SDL2", .{});
exe_mod.linkSystemLibrary("SDL3", .{});
}
if (platform == .sdl2) {
exe_mod.linkSystemLibrary("SDL2", .{});
}
if (platform == .sdl3) {
exe_mod.linkSystemLibrary("SDL3", .{});
}
if (std.mem.eql(u8, filename, "rlgl_standalone")) {
if (platform != .glfw) continue;
exe_mod.addIncludePath(b.path("src"));