Fix weird sdl linkage build.zig
This commit is contained in:
parent
cd4c816453
commit
b2a84f732e
22
build.zig
22
build.zig
|
|
@ -658,17 +658,6 @@ fn addExamples(
|
||||||
var dir = try b.build_root.handle.openDir(b.graph.io, module_subpath, .{ .iterate = true });
|
var dir = try b.build_root.handle.openDir(b.graph.io, module_subpath, .{ .iterate = true });
|
||||||
defer dir.close(b.graph.io);
|
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();
|
var iter = dir.iterate();
|
||||||
while (try iter.next(b.graph.io)) |entry| {
|
while (try iter.next(b.graph.io)) |entry| {
|
||||||
if (entry.kind != .file) continue;
|
if (entry.kind != .file) continue;
|
||||||
|
|
@ -687,6 +676,17 @@ fn addExamples(
|
||||||
exe_mod.addCSourceFile(.{ .file = b.path(path) });
|
exe_mod.addCSourceFile(.{ .file = b.path(path) });
|
||||||
exe_mod.linkLibrary(raylib);
|
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 (std.mem.eql(u8, filename, "rlgl_standalone")) {
|
||||||
if (platform != .glfw) continue;
|
if (platform != .glfw) continue;
|
||||||
exe_mod.addIncludePath(b.path("src"));
|
exe_mod.addIncludePath(b.path("src"));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user