From 57adbef211cc1244487322485776828e165c0954 Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Fri, 7 Jul 2023 21:17:10 -0700 Subject: [PATCH] gpu-dawn: use mach-glfw via package manager Signed-off-by: Stephen Gutekanst --- libs/gpu-dawn/build.zig | 11 ++++++++--- libs/gpu-dawn/build.zig.zon | 4 ++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/libs/gpu-dawn/build.zig b/libs/gpu-dawn/build.zig index 0833b123..f8b396f8 100644 --- a/libs/gpu-dawn/build.zig +++ b/libs/gpu-dawn/build.zig @@ -4,7 +4,6 @@ const Build = std.Build; pub fn build(b: *Build) !void { const optimize = b.standardOptimizeOption(.{}); const target = b.standardTargetOptions(.{}); - const glfw = @import("mach_glfw"); const options = Options{ .install_libs = true, .from_source = true, @@ -19,8 +18,14 @@ pub fn build(b: *Build) !void { .optimize = optimize, }); try link(b, example, options); - try glfw.link(b, example, .{}); - example.addModule("glfw", glfw.module(b)); + + const glfw_dep = b.dependency("mach_glfw", .{ + .target = example.target, + .optimize = example.optimize, + }); + example.linkLibrary(glfw_dep.artifact("mach-glfw")); + example.addModule("mach-glfw", glfw_dep.module("mach-glfw")); + b.installArtifact(example); } diff --git a/libs/gpu-dawn/build.zig.zon b/libs/gpu-dawn/build.zig.zon index 7210ccd6..949cf960 100644 --- a/libs/gpu-dawn/build.zig.zon +++ b/libs/gpu-dawn/build.zig.zon @@ -3,8 +3,8 @@ .version = "0.2.0", .dependencies = .{ .mach_glfw = .{ - .url = "https://github.com/hexops/mach-glfw/archive/ddb1cf1cb712fd60fc7f8d14e8f84925e557562a.tar.gz", - .hash = "122034c6b14f8c4ee65bc99efc673c4d71661ad8bb52a485da9b623ec6b8cd9ab8e9", + .url = "https://github.com/hexops/mach-glfw/archive/b119c63dd77764eeafe758d54accd0329821a729.tar.gz", + .hash = "1220fb0fb65621a4fc7406e4f74a87a0c60208f8a257cd7ca4e20da0925f875e70d0", }, .glfw = .{ .url = "https://github.com/hexops/glfw/archive/49c21c3d2fcaf9799b593f5320ce8e598a692c74.tar.gz",