diff options
| author | 2025-05-11 16:30:47 -0400 | |
|---|---|---|
| committer | 2025-05-15 15:31:15 -0400 | |
| commit | e3dbcc70688321e48ac31599105c51edac2736af (patch) | |
| tree | 49ce6f507d9f4c846cccc07f9ed2d942a0930a7a /build.zig | |
| parent | Various small iterator improvements (diff) | |
| download | zg-e3dbcc70688321e48ac31599105c51edac2736af.tar.gz zg-e3dbcc70688321e48ac31599105c51edac2736af.tar.xz zg-e3dbcc70688321e48ac31599105c51edac2736af.zip | |
Add WordBreakPropertyData
Passes some simple lookup tests.
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 28 |
1 files changed, 28 insertions, 0 deletions
| @@ -22,6 +22,15 @@ 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 | const wbp_gen_exe = b.addExecutable(.{ | ||
| 26 | .name = "wbp", | ||
| 27 | .root_source_file = b.path("codegen/wbp.zig"), | ||
| 28 | .target = b.graph.host, | ||
| 29 | .optimize = .Debug, | ||
| 30 | }); | ||
| 31 | const run_wbp_gen_exe = b.addRunArtifact(wbp_gen_exe); | ||
| 32 | const wbp_gen_out = run_wbp_gen_exe.addOutputFileArg("wbp.bin.z"); | ||
| 33 | |||
| 25 | // Display width | 34 | // Display width |
| 26 | const cjk = b.option(bool, "cjk", "Ambiguous code points are wide (display width: 2).") orelse false; | 35 | const cjk = b.option(bool, "cjk", "Ambiguous code points are wide (display width: 2).") orelse false; |
| 27 | const options = b.addOptions(); | 36 | const options = b.addOptions(); |
| @@ -183,6 +192,7 @@ pub fn build(b: *std.Build) void { | |||
| 183 | const props_gen_out = run_props_gen_exe.addOutputFileArg("props.bin.z"); | 192 | const props_gen_out = run_props_gen_exe.addOutputFileArg("props.bin.z"); |
| 184 | 193 | ||
| 185 | // Modules we provide | 194 | // Modules we provide |
| 195 | |||
| 186 | // Code points | 196 | // Code points |
| 187 | const code_point = b.addModule("code_point", .{ | 197 | const code_point = b.addModule("code_point", .{ |
| 188 | .root_source_file = b.path("src/code_point.zig"), | 198 | .root_source_file = b.path("src/code_point.zig"), |
| @@ -215,6 +225,23 @@ 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 | // Word Breaking | ||
| 229 | const word_break = b.addModule("WordBreak", .{ | ||
| 230 | .root_source_file = b.path("src/WordBreak.zig"), | ||
| 231 | .target = target, | ||
| 232 | .optimize = optimize, | ||
| 233 | }); | ||
| 234 | word_break.addAnonymousImport("wbp", .{ .root_source_file = wbp_gen_out }); | ||
| 235 | word_break.addImport("code_point", code_point); | ||
| 236 | |||
| 237 | const word_break_t = b.addTest(.{ | ||
| 238 | .name = "WordBreak", | ||
| 239 | .root_module = word_break, | ||
| 240 | .target = target, | ||
| 241 | .optimize = optimize, | ||
| 242 | }); | ||
| 243 | const word_break_tr = b.addRunArtifact(word_break_t); | ||
| 244 | |||
| 218 | // ASCII utilities | 245 | // ASCII utilities |
| 219 | const ascii = b.addModule("ascii", .{ | 246 | const ascii = b.addModule("ascii", .{ |
| 220 | .root_source_file = b.path("src/ascii.zig"), | 247 | .root_source_file = b.path("src/ascii.zig"), |
| @@ -452,6 +479,7 @@ pub fn build(b: *std.Build) void { | |||
| 452 | test_step.dependOn(&code_point_tr.step); | 479 | test_step.dependOn(&code_point_tr.step); |
| 453 | test_step.dependOn(&display_width_tr.step); | 480 | test_step.dependOn(&display_width_tr.step); |
| 454 | test_step.dependOn(&grapheme_tr.step); | 481 | test_step.dependOn(&grapheme_tr.step); |
| 482 | test_step.dependOn(&word_break_tr.step); | ||
| 455 | test_step.dependOn(&ascii_tr.step); | 483 | test_step.dependOn(&ascii_tr.step); |
| 456 | test_step.dependOn(&ccc_data_tr.step); | 484 | test_step.dependOn(&ccc_data_tr.step); |
| 457 | test_step.dependOn(&canon_data_tr.step); | 485 | test_step.dependOn(&canon_data_tr.step); |