From d7df2b4b92e198fbdbe5cfc29095d48980675004 Mon Sep 17 00:00:00 2001 From: Jacob Sandlund Date: Tue, 24 Jun 2025 07:55:16 -0400 Subject: Add Emoji module and codegen/emoji --- build.zig | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'build.zig') diff --git a/build.zig b/build.zig index 58fd3e7..839cf13 100644 --- a/build.zig +++ b/build.zig @@ -22,6 +22,16 @@ pub fn build(b: *std.Build) void { const run_gbp_gen_exe = b.addRunArtifact(gbp_gen_exe); const gbp_gen_out = run_gbp_gen_exe.addOutputFileArg("gbp.bin.z"); + // Emoji + const emoji_gen_exe = b.addExecutable(.{ + .name = "emoji", + .root_source_file = b.path("codegen/emoji.zig"), + .target = b.graph.host, + .optimize = .Debug, + }); + const run_emoji_gen_exe = b.addRunArtifact(emoji_gen_exe); + const emoji_gen_out = run_emoji_gen_exe.addOutputFileArg("emoji.bin.z"); + // Display width const cjk = b.option(bool, "cjk", "Ambiguous code points are wide (display width: 2).") orelse false; const options = b.addOptions(); @@ -215,6 +225,22 @@ pub fn build(b: *std.Build) void { }); const grapheme_tr = b.addRunArtifact(grapheme_t); + // Emoji module + const emoji = b.addModule("Emoji", .{ + .root_source_file = b.path("src/Emoji.zig"), + .target = target, + .optimize = optimize, + }); + emoji.addAnonymousImport("emoji", .{ .root_source_file = emoji_gen_out }); + + const emoji_t = b.addTest(.{ + .name = "Emoji", + .root_module = emoji, + .target = target, + .optimize = optimize, + }); + const emoji_tr = b.addRunArtifact(emoji_t); + // ASCII utilities const ascii = b.addModule("ascii", .{ .root_source_file = b.path("src/ascii.zig"), @@ -452,6 +478,7 @@ pub fn build(b: *std.Build) void { test_step.dependOn(&code_point_tr.step); test_step.dependOn(&display_width_tr.step); test_step.dependOn(&grapheme_tr.step); + test_step.dependOn(&emoji_tr.step); test_step.dependOn(&ascii_tr.step); test_step.dependOn(&ccc_data_tr.step); test_step.dependOn(&canon_data_tr.step); -- cgit v1.2.3