summaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
authorGravatar Jacob Sandlund2025-06-24 07:55:16 -0400
committerGravatar Jacob Sandlund2025-06-24 07:55:16 -0400
commitd7df2b4b92e198fbdbe5cfc29095d48980675004 (patch)
tree3a6a8afa88dfcbee6b5733769604060d0f95b7b9 /build.zig
parentMerge pull request 'Fix benchmarks' (#56) from jacobsandlund/zg:benchmarks in... (diff)
downloadzg-d7df2b4b92e198fbdbe5cfc29095d48980675004.tar.gz
zg-d7df2b4b92e198fbdbe5cfc29095d48980675004.tar.xz
zg-d7df2b4b92e198fbdbe5cfc29095d48980675004.zip
Add Emoji module and codegen/emoji
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig27
1 files changed, 27 insertions, 0 deletions
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 {
22 const run_gbp_gen_exe = b.addRunArtifact(gbp_gen_exe); 22 const run_gbp_gen_exe = b.addRunArtifact(gbp_gen_exe);
23 const gbp_gen_out = run_gbp_gen_exe.addOutputFileArg("gbp.bin.z"); 23 const gbp_gen_out = run_gbp_gen_exe.addOutputFileArg("gbp.bin.z");
24 24
25 // Emoji
26 const emoji_gen_exe = b.addExecutable(.{
27 .name = "emoji",
28 .root_source_file = b.path("codegen/emoji.zig"),
29 .target = b.graph.host,
30 .optimize = .Debug,
31 });
32 const run_emoji_gen_exe = b.addRunArtifact(emoji_gen_exe);
33 const emoji_gen_out = run_emoji_gen_exe.addOutputFileArg("emoji.bin.z");
34
25 // Display width 35 // Display width
26 const cjk = b.option(bool, "cjk", "Ambiguous code points are wide (display width: 2).") orelse false; 36 const cjk = b.option(bool, "cjk", "Ambiguous code points are wide (display width: 2).") orelse false;
27 const options = b.addOptions(); 37 const options = b.addOptions();
@@ -215,6 +225,22 @@ pub fn build(b: *std.Build) void {
215 }); 225 });
216 const grapheme_tr = b.addRunArtifact(grapheme_t); 226 const grapheme_tr = b.addRunArtifact(grapheme_t);
217 227
228 // Emoji module
229 const emoji = b.addModule("Emoji", .{
230 .root_source_file = b.path("src/Emoji.zig"),
231 .target = target,
232 .optimize = optimize,
233 });
234 emoji.addAnonymousImport("emoji", .{ .root_source_file = emoji_gen_out });
235
236 const emoji_t = b.addTest(.{
237 .name = "Emoji",
238 .root_module = emoji,
239 .target = target,
240 .optimize = optimize,
241 });
242 const emoji_tr = b.addRunArtifact(emoji_t);
243
218 // ASCII utilities 244 // ASCII utilities
219 const ascii = b.addModule("ascii", .{ 245 const ascii = b.addModule("ascii", .{
220 .root_source_file = b.path("src/ascii.zig"), 246 .root_source_file = b.path("src/ascii.zig"),
@@ -452,6 +478,7 @@ pub fn build(b: *std.Build) void {
452 test_step.dependOn(&code_point_tr.step); 478 test_step.dependOn(&code_point_tr.step);
453 test_step.dependOn(&display_width_tr.step); 479 test_step.dependOn(&display_width_tr.step);
454 test_step.dependOn(&grapheme_tr.step); 480 test_step.dependOn(&grapheme_tr.step);
481 test_step.dependOn(&emoji_tr.step);
455 test_step.dependOn(&ascii_tr.step); 482 test_step.dependOn(&ascii_tr.step);
456 test_step.dependOn(&ccc_data_tr.step); 483 test_step.dependOn(&ccc_data_tr.step);
457 test_step.dependOn(&canon_data_tr.step); 484 test_step.dependOn(&canon_data_tr.step);