From 423d0d58c09d3ec8bd1710924e62f6f1359369f1 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 27 Oct 2023 15:11:04 -0700 Subject: [PATCH] build: do not build glfw for gtk anymore --- build.zig | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/build.zig b/build.zig index e6e95b0fe..cc914dca2 100644 --- a/build.zig +++ b/build.zig @@ -795,30 +795,24 @@ fn addDeps( // get access to glib for dbus. if (flatpak) step.linkSystemLibrary2("gtk4", dynamic_link_opts); - // We may link GLFW below - const glfw_dep = b.dependency("glfw", .{ - .target = step.target, - .optimize = step.optimize, - .x11 = step.target.isLinux(), - .wayland = step.target.isLinux(), - .metal = step.target.isDarwin(), - }); - switch (app_runtime) { .none => {}, .glfw => { + const glfw_dep = b.dependency("glfw", .{ + .target = step.target, + .optimize = step.optimize, + .x11 = step.target.isLinux(), + .wayland = step.target.isLinux(), + .metal = step.target.isDarwin(), + }); + step.addModule("glfw", mach_glfw_dep.module("mach-glfw")); step.linkLibrary(mach_glfw_dep.artifact("mach-glfw")); step.linkLibrary(glfw_dep.artifact("glfw")); }, .gtk => { - // We need glfw for GTK because we use GLFW to get DPI. - step.addModule("glfw", mach_glfw_dep.module("mach-glfw")); - step.linkLibrary(mach_glfw_dep.artifact("mach-glfw")); - step.linkLibrary(glfw_dep.artifact("glfw")); - step.linkSystemLibrary2("gtk4", dynamic_link_opts); }, }