core: more code refactoring / improvements

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2024-08-25 15:45:43 -07:00
parent de1275dc0a
commit 470a84909b
6 changed files with 7 additions and 35 deletions

View file

@ -267,14 +267,14 @@ pub fn build(b: *std.Build) !void {
pub const Platform = enum {
wasm,
win32,
windows,
darwin,
null,
pub fn fromTarget(target: std.Target) Platform {
if (target.cpu.arch == .wasm32) return .wasm;
if (target.os.tag.isDarwin()) return .darwin;
if (target.os.tag == .windows) return .win32;
if (target.os.tag == .windows) return .windows;
return .null;
}
};