can specify a wasm target in build

This commit is contained in:
Mitchell Hashimoto
2022-12-31 08:53:11 -08:00
parent 1093cf5254
commit ce490e21ea
11 changed files with 69 additions and 3 deletions

View File

@@ -12,13 +12,16 @@ const builtin = @import("builtin");
pub usingnamespace @import("apprt/structs.zig");
pub const glfw = @import("apprt/glfw.zig");
pub const browser = @import("apprt/browser.zig");
pub const Window = @import("apprt/Window.zig");
/// The implementation to use for the app runtime. This is comptime chosen
/// so that every build has exactly one application runtime implementation.
/// Note: it is very rare to use Runtime directly; most usage will use
/// Window or something.
pub const runtime = switch (builtin.os.tag) {
pub const runtime = if (builtin.target.isWasm())
browser
else switch (builtin.os.tag) {
else => glfw,
};