aboutsummaryrefslogtreecommitdiff
path: root/src/z/AppBundle.zig
diff options
context:
space:
mode:
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();
+}