From 32a251aa9645de070727a6ec91490d3e9219ec7c Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Fri, 9 Oct 2026 14:01:20 +0200 Subject: rename z framework to zeroscript --- src/zeroscript/AppBundle.zig | 49 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 src/zeroscript/AppBundle.zig (limited to 'src/zeroscript/AppBundle.zig') diff --git a/src/zeroscript/AppBundle.zig b/src/zeroscript/AppBundle.zig new file mode 100644 index 0000000..1d4ebb9 --- /dev/null +++ b/src/zeroscript/AppBundle.zig @@ -0,0 +1,49 @@ +const std = @import("std"); + +pub const Options = struct { + root_source_file: std.Build.LazyPath, + target: std.Build.ResolvedTarget, +}; + +mod: *std.Build.Module, +wasm: struct { + mod: *std.Build.Module, + exe: *std.Build.Step.Compile, +}, + +pub fn init(b: *std.Build, options: Options, zeroscript_mod: *std.Build.Module) @This() { + const module = b.addModule("site", .{ + .root_source_file = options.root_source_file, + .target = options.target, + .imports = &.{ .{ .name = "zeroscript", .module = zeroscript_mod } }, + }); + + const wasm_module = b.createModule(.{ + .root_source_file = options.root_source_file, + .target = b.resolveTargetQuery(.{ + .cpu_arch = .wasm32, + .os_tag = .freestanding, + }), + .imports = &.{ .{ .name = "zeroscript", .module = zeroscript_mod } }, + }); + + const exe = b.addExecutable(.{ + .name = "runtime", + .root_module = wasm_module, + }); + + exe.rdynamic = true; + exe.entry = .disabled; + + return .{ + .mod = module, + .wasm = .{ + .exe = exe, + .mod = wasm_module, + }, + }; +} + +pub fn getEmittedWasm(self: *const @This()) std.Build.LazyPath { + return self.wasm.exe.getEmittedBin(); +} -- cgit v1.2.3-70-g09d2