From b23136fdaa972ba1ecf28dae26c79d406317c713 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 30 Mar 2022 17:36:18 -0700 Subject: [PATCH] build gpu-dawn --- build.zig | 9 ++++++++- src/main.zig | 2 +- vendor/mach | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/build.zig b/build.zig index 35544d4ac..4d27e74d7 100644 --- a/build.zig +++ b/build.zig @@ -1,8 +1,10 @@ const std = @import("std"); -const glfw = @import("vendor/mach/glfw/build.zig"); const Builder = std.build.Builder; const LibExeObjStep = std.build.LibExeObjStep; +const glfw = @import("vendor/mach/glfw/build.zig"); +const gpu_dawn = @import("vendor/mach/gpu-dawn/build.zig"); + pub fn build(b: *std.build.Builder) void { const target = b.standardTargetOptions(.{}); const mode = b.standardReleaseOptions(); @@ -13,6 +15,11 @@ pub fn build(b: *std.build.Builder) void { exe.install(); exe.addPackagePath("glfw", "vendor/mach/glfw/src/main.zig"); glfw.link(b, exe, .{}); + gpu_dawn.link(b, exe, if (target.getCpuArch() == .aarch64) .{ + // We only need to do this until there is an aarch64 binary build. + .separate_libs = true, + .from_source = true, + } else .{}); const run_cmd = exe.run(); run_cmd.step.dependOn(b.getInstallStep()); diff --git a/src/main.zig b/src/main.zig index 49d028618..b64bdf644 100644 --- a/src/main.zig +++ b/src/main.zig @@ -6,7 +6,7 @@ pub fn main() !void { defer glfw.terminate(); // Create our window - const window = try glfw.Window.create(640, 480, "Hello, mach-glfw!", null, null, .{}); + const window = try glfw.Window.create(640, 480, "ghostty", null, null, .{}); defer window.destroy(); // Wait for the user to close the window. diff --git a/vendor/mach b/vendor/mach index d26c76b07..88ee3bf66 160000 --- a/vendor/mach +++ b/vendor/mach @@ -1 +1 @@ -Subproject commit d26c76b074c243365de086ed56448455b7988b69 +Subproject commit 88ee3bf6684bdd202f170e44f07b2d466a42a3bf