╭ changed ╮ │build.zig│ ╰─────────╯ ╭───────────────────────────────────────────────────────╮ │ 4 const xit_dep = b.dependency("xit", .{}); │ │ 5 │ │ 6 // wasm │ │ 7 - const install_wasm_exe = blk: { │ │ 7 + const wasm_exe = blk: { │ │ 8 const wasm_target = b.resolveTargetQuery(.{│ │ 9 .cpu_arch = .wasm32, │ │10 .os_tag = .freestanding, │ ╰───────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────╮ │35 exe.max_memory = std.wasm.page_size * max_pages; │ │36 │ │37 const install_exe = b.addInstallArtifact(exe, .{}); │ │38 - b.getInstallStep().dependOn(&install_exe.step); │ │38 │ │39 const wasm_step = b.step("wasm", "Generate the wasm");│ │40 wasm_step.dependOn(&install_exe.step); │ ╰──────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────╮ │41 │ │43 - // windows can't follow symlinks, so copy the wasm file to the embed dir │ │44 - if (.windows == @import("builtin").os.tag) { │ │45 - const copy_wasm = b.addUpdateSourceFiles(); │ │46 - copy_wasm.addCopyFileToSource(exe.getEmittedBin(), "src/embed/haxy.wasm");│ │47 - b.getInstallStep().dependOn(&copy_wasm.step); │ │48 - break :blk copy_wasm; │ │49 - } │ │50 - │ │51 - break :blk install_exe; │ │42 + break :blk exe; │ │43 }; │ │44 │ │45 const target = b.standardTargetOptions(.{}); │ ╰──────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────╮ │58 .use_llvm = true, │ │59 }); │ │60 exe.root_module.addImport("xit", xit_dep.module("xit"));│ │70 - exe.step.dependOn(&install_wasm_exe.step); │ │61 + exe.root_module.addAnonymousImport("haxy.wasm", .{ │ │62 + .root_source_file = wasm_exe.getEmittedBin(), │ │63 + }); │ │64 │ │65 const install_exe = b.addInstallArtifact(exe, .{}); │ │66 b.getInstallStep().dependOn(&install_exe.step); │ ╰────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────╮ │91 .root_source_file = b.path("src/lib.zig"), │ │92 }); │ │93 haxy.addImport("xit", xit_dep.module("xit")); │ │94 + haxy.addAnonymousImport("haxy.wasm", .{ │ │95 + .root_source_file = wasm_exe.getEmittedBin(),│ │96 + }); │ │97 │ │98 // try │ │99 { │ ╰─────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────╮ │106 }), │ │107 }); │ │108 exe.root_module.addImport("haxy", haxy); │ │113 - exe.step.dependOn(&install_wasm_exe.step); │ │109 const try_install = b.addInstallArtifact(exe, .{});│ │110 │ │111 const run_cmd = b.addRunArtifact(exe); │ ╰────────────────────────────────────────────────────────────────╯ ╭ removed ──────────╮ │src/embed/haxy.wasm│ ╰───────────────────╯ ╭ changed ──╮ │src/web.zig│ ╰───────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │24 .{ .path = "index.html", .content_type = "text/html; charset=utf-8", .body = @embedFile("embed/index.html") }, │ │25 .{ .path = "script.js", .content_type = "text/javascript; charset=utf-8", .body = @embedFile("embed/script.js") },│ │26 .{ .path = "term.ttf", .content_type = "font/ttf", .body = @embedFile("embed/term.ttf") }, │ │27 - .{ .path = "haxy.wasm", .content_type = "application/wasm", .body = @embedFile("embed/haxy.wasm") }, │ │27 + .{ .path = "haxy.wasm", .content_type = "application/wasm", .body = @embedFile("haxy.wasm") }, │ │28 }; │ │29 │ │30 pub fn handleConnection( │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯