WIP: Update to new build module API after Zig PR #18160

Temporarily change dependency sources to forks until they update
This commit is contained in:
Krzysztof Wolicki
2024-01-03 21:50:32 +01:00
parent f93c41669e
commit 1913243c35
20 changed files with 213 additions and 172 deletions

View File

@@ -53,12 +53,12 @@ pub const Runtime = enum {
/// GTK-backed. Rich windowed application. GTK is dynamically linked.
gtk,
pub fn default(target: std.zig.CrossTarget) Runtime {
pub fn default(target: std.Target) Runtime {
// The Linux default is GTK because it is full featured.
if (target.isLinux()) return .gtk;
if (target.os.tag == .linux) return .gtk;
// Windows we currently only support glfw
if (target.isWindows()) return .glfw;
if (target.os.tag == .windows) return .glfw;
// Otherwise, we do NONE so we don't create an exe. The GLFW
// build is opt-in because it is missing so many features compared

View File

@@ -63,10 +63,10 @@ pub const Backend = enum {
/// meant to be called at comptime by the build.zig script. To get the
/// backend look at build_options.
pub fn default(
target: std.zig.CrossTarget,
target: std.Target,
wasm_target: WasmTarget,
) Backend {
if (target.getCpuArch() == .wasm32) {
if (target.cpu.arch == .wasm32) {
return switch (wasm_target) {
.browser => .web_canvas,
};

View File

@@ -30,10 +30,10 @@ pub const Impl = enum {
webgl,
pub fn default(
target: std.zig.CrossTarget,
target: std.Target,
wasm_target: WasmTarget,
) Impl {
if (target.getCpuArch() == .wasm32) {
if (target.cpu.arch == .wasm32) {
return switch (wasm_target) {
.browser => .webgl,
};