╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ build.zig ────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
180 if (names.items.len == 0) @panic("src/embed/ansi must contain at least one .txt file"); 181 182 const contents = b.allocator.alloc([]const u8, names.items.len) catch @panic("OOM"); 183 for (names.items, contents) |name, *content| { 184 content.* = dir.readFileAlloc(io, name, b.allocator, .limited(16 * 1024 * 1024)) catch |err| { 185 std.debug.panic("unable to read src/embed/ansi/{s}: {t}", .{ name, err }); 186 }; 187 } 188 189 const options = b.addOptions(); 190 options.addOption([]const []const u8, "art", contents); 191 return options.createModule(); 192 } 193