aboutsummaryrefslogtreecommitdiff
path: root/src/z/AppBundle.zig
diff options
context:
space:
mode:
authorNathan Reiner <nathan@nathanreiner.xyz>2026-10-05 15:33:46 +0200
committerNathan Reiner <nathan@nathanreiner.xyz>2026-10-05 15:33:46 +0200
commit02582cc490fc0d753dd153211cc172eb28fbee5d (patch)
tree4add149d5e1ecf28cf20ecb497626fef85cdbd75 /src/z/AppBundle.zig
parent2f3199622d9e7a97da4b5c31a2d81b170b7cdaa6 (diff)
first sketch of wasm environment
Diffstat (limited to 'src/z/AppBundle.zig')
-rw-r--r--src/z/AppBundle.zig35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/z/AppBundle.zig b/src/z/AppBundle.zig
new file mode 100644
index 0000000..3fec9fb
--- /dev/null
+++ b/src/z/AppBundle.zig
@@ -0,0 +1,35 @@
+const std = @import("std");
+
+pub const Options = struct {
+ root_source_file: std.Build.LazyPath,
+};
+
+mod: *std.Build.Module,
+wasm: *std.Build.Step.Compile,
+
+pub fn init(b: *std.Build, options: Options) @This() {
+ const module = b.createModule(.{
+ .root_source_file = options.root_source_file,
+ .target = b.resolveTargetQuery(.{
+ .cpu_arch = .wasm32,
+ .os_tag = .freestanding,
+ }),
+ });
+
+ const exe = b.addExecutable(.{
+ .name = "runtime",
+ .root_module = module,
+ });
+
+ exe.rdynamic = true;
+ exe.entry = .disabled;
+
+ return .{
+ .wasm = exe,
+ .mod = module,
+ };
+}
+
+pub fn getEmittedWasm(self: *const @This()) std.Build.LazyPath {
+ return self.wasm.getEmittedBin();
+}