diff --git a/build.zig b/build.zig index 2e65f5c..947c212 100644 --- a/build.zig +++ b/build.zig @@ -65,12 +65,12 @@ pub fn build(b: *std.build.Builder) !void { try c_sources.append("src/windows/WinMiniFB.c"); lib.linkSystemLibrary("gdi32"); switch (use_backend) { - .gdi, .default => {}, - .opengl => { + .opengl, .default => { try c_flags.append("-DUSE_OPENGL_API"); try c_sources.append("src/gl/MiniFB_GL.c"); lib.linkSystemLibraryName("opengl32"); }, + .gdi => {}, else => { return ConfigError.BackendNotSupported; } @@ -80,11 +80,7 @@ pub fn build(b: *std.build.Builder) !void { try c_sources.append("src/MiniFB_linux.c"); lib.linkSystemLibrary("rt"); switch (use_backend) { - .x11, .default => { - try c_sources.append("src/x11/X11MiniFB.c"); - lib.linkSystemLibrary("X11"); - }, - .opengl => { + .opengl, .default => { try c_sources.append("src/x11/X11MiniFB.c"); lib.linkSystemLibrary("X11"); @@ -92,6 +88,10 @@ pub fn build(b: *std.build.Builder) !void { try c_sources.append("src/gl/MiniFB_GL.c"); lib.linkSystemLibrary("GL"); }, + .x11 => { + try c_sources.append("src/x11/X11MiniFB.c"); + lib.linkSystemLibrary("X11"); + }, .wayland => { try c_sources.append("src/wayland/WaylandMiniFB.c"); lib.linkSystemLibrary("wayland-client");