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(); }