mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-01-02 03:22:37 +00:00
24 lines
534 B
Zig
24 lines
534 B
Zig
const std = @import("std");
|
|
const WasmTarget = @import("../os/wasm/target.zig").Target;
|
|
|
|
/// Possible implementations, used for build options.
|
|
pub const Backend = enum {
|
|
opengl,
|
|
metal,
|
|
webgl,
|
|
|
|
pub fn default(
|
|
target: std.Target,
|
|
wasm_target: WasmTarget,
|
|
) Backend {
|
|
if (target.cpu.arch == .wasm32) {
|
|
return switch (wasm_target) {
|
|
.browser => .webgl,
|
|
};
|
|
}
|
|
|
|
if (target.os.tag.isDarwin()) return .metal;
|
|
return .opengl;
|
|
}
|
|
};
|