build gpu-dawn

This commit is contained in:
Mitchell Hashimoto
2022-03-30 17:36:18 -07:00
parent 81982a5d99
commit b23136fdaa
3 changed files with 10 additions and 3 deletions

View File

@ -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());

View File

@ -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.

2
vendor/mach vendored

@ -1 +1 @@
Subproject commit d26c76b074c243365de086ed56448455b7988b69
Subproject commit 88ee3bf6684bdd202f170e44f07b2d466a42a3bf