From a44b41f7793c0416f8dabffbaf733d90244720f7 Mon Sep 17 00:00:00 2001 From: Brandon Dyck Date: Sun, 12 Dec 2021 16:20:27 -0700 Subject: [PATCH] Match zig build defaults to cmake --- build.zig | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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");