Match zig build defaults to cmake
This commit is contained in:
parent
35c01159c2
commit
a44b41f779
14
build.zig
14
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");
|
||||
|
Loading…
Reference in New Issue
Block a user