Skip to content

Commit

Permalink
core: remove core_platform build option and remove Null.zig
Browse files Browse the repository at this point in the history
  • Loading branch information
joshua-holmes committed Jan 3, 2025
1 parent 5796fcd commit 8e2b1bf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 96 deletions.
2 changes: 0 additions & 2 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ pub fn build(b: *std.Build) !void {
const target = b.standardTargetOptions(.{});

const sysgpu_backend = b.option(SysgpuBackend, "sysgpu_backend", "sysgpu API backend") orelse .default;
const core_platform = b.option(Platform, "core_platform", "mach core platform to use") orelse Platform.fromTarget(target.result);

const build_examples = b.option(bool, "examples", "build/install examples specifically");
const build_libs = b.option(bool, "libs", "build/install libraries specifically");
Expand All @@ -68,7 +67,6 @@ pub fn build(b: *std.Build) !void {
build_options.addOption(bool, "want_sysaudio", want_sysaudio);
build_options.addOption(bool, "want_sysgpu", want_sysgpu);
build_options.addOption(SysgpuBackend, "sysgpu_backend", sysgpu_backend);
build_options.addOption(Platform, "core_platform", core_platform);

var examples = [_]Example{
.{ .name = "core-custom-entrypoint", .deps = &.{} },
Expand Down
15 changes: 10 additions & 5 deletions src/Core.zig
Original file line number Diff line number Diff line change
Expand Up @@ -420,12 +420,17 @@ pub fn detectBackendType(allocator: std.mem.Allocator) !gpu.BackendType {
@panic("unknown MACH_GPU_BACKEND type");
}

const Platform = switch (build_options.core_platform) {
.wasm => @panic("TODO: support mach.Core WASM platform"),
const Platform = switch (builtin.target.os.tag) {
.wasi => @panic("TODO: support mach.Core WASM platform"),
.ios => @panic("TODO: support mach.Core IOS platform"),
.windows => @import("core/Windows.zig"),
.linux => @import("core/Linux.zig"),
.darwin => @import("core/Darwin.zig"),
.null => @import("core/Null.zig"),
.linux => blk: {
if (builtin.target.abi.isAndroid())
@panic("TODO: support mach.Core Android platform");
break :blk @import("core/Linux.zig");
},
.macos => @import("core/Darwin.zig"),
else => {},
};

pub const InputState = struct {
Expand Down
89 changes: 0 additions & 89 deletions src/core/Null.zig

This file was deleted.

0 comments on commit 8e2b1bf

Please sign in to comment.