mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
build gpu-dawn
This commit is contained in:
@ -1,8 +1,10 @@
|
|||||||
const std = @import("std");
|
const std = @import("std");
|
||||||
const glfw = @import("vendor/mach/glfw/build.zig");
|
|
||||||
const Builder = std.build.Builder;
|
const Builder = std.build.Builder;
|
||||||
const LibExeObjStep = std.build.LibExeObjStep;
|
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 {
|
pub fn build(b: *std.build.Builder) void {
|
||||||
const target = b.standardTargetOptions(.{});
|
const target = b.standardTargetOptions(.{});
|
||||||
const mode = b.standardReleaseOptions();
|
const mode = b.standardReleaseOptions();
|
||||||
@ -13,6 +15,11 @@ pub fn build(b: *std.build.Builder) void {
|
|||||||
exe.install();
|
exe.install();
|
||||||
exe.addPackagePath("glfw", "vendor/mach/glfw/src/main.zig");
|
exe.addPackagePath("glfw", "vendor/mach/glfw/src/main.zig");
|
||||||
glfw.link(b, exe, .{});
|
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();
|
const run_cmd = exe.run();
|
||||||
run_cmd.step.dependOn(b.getInstallStep());
|
run_cmd.step.dependOn(b.getInstallStep());
|
||||||
|
@ -6,7 +6,7 @@ pub fn main() !void {
|
|||||||
defer glfw.terminate();
|
defer glfw.terminate();
|
||||||
|
|
||||||
// Create our window
|
// 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();
|
defer window.destroy();
|
||||||
|
|
||||||
// Wait for the user to close the window.
|
// Wait for the user to close the window.
|
||||||
|
2
vendor/mach
vendored
2
vendor/mach
vendored
@ -1 +1 @@
|
|||||||
Subproject commit d26c76b074c243365de086ed56448455b7988b69
|
Subproject commit 88ee3bf6684bdd202f170e44f07b2d466a42a3bf
|
Reference in New Issue
Block a user