diff options
| author | 2024-02-18 17:04:22 -0400 | |
|---|---|---|
| committer | 2024-02-18 17:04:22 -0400 | |
| commit | 4eb86edf5dea66edebdc41ab2cccf3bf30295520 (patch) | |
| tree | 05845ade9a04353bbbaaef35f4840d6d4ebca15d /build.zig | |
| parent | Using argsWithAllocator for Windows (diff) | |
| download | zg-4eb86edf5dea66edebdc41ab2cccf3bf30295520.tar.gz zg-4eb86edf5dea66edebdc41ab2cccf3bf30295520.tar.xz zg-4eb86edf5dea66edebdc41ab2cccf3bf30295520.zip | |
center, padLeft, padRight, and wrap
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 14 |
1 files changed, 13 insertions, 1 deletions
| @@ -34,12 +34,14 @@ pub fn build(b: *std.Build) void { | |||
| 34 | const dwp_gen_out = run_dwp_gen_exe.addOutputFileArg("dwp.zig"); | 34 | const dwp_gen_out = run_dwp_gen_exe.addOutputFileArg("dwp.zig"); |
| 35 | 35 | ||
| 36 | // Modules we provide | 36 | // Modules we provide |
| 37 | // Code points | ||
| 37 | const code_point = b.addModule("code_point", .{ | 38 | const code_point = b.addModule("code_point", .{ |
| 38 | .root_source_file = .{ .path = "src/code_point.zig" }, | 39 | .root_source_file = .{ .path = "src/code_point.zig" }, |
| 39 | .target = target, | 40 | .target = target, |
| 40 | .optimize = optimize, | 41 | .optimize = optimize, |
| 41 | }); | 42 | }); |
| 42 | 43 | ||
| 44 | // Grapheme clusters | ||
| 43 | const grapheme = b.addModule("grapheme", .{ | 45 | const grapheme = b.addModule("grapheme", .{ |
| 44 | .root_source_file = .{ .path = "src/grapheme.zig" }, | 46 | .root_source_file = .{ .path = "src/grapheme.zig" }, |
| 45 | .target = target, | 47 | .target = target, |
| @@ -48,11 +50,20 @@ pub fn build(b: *std.Build) void { | |||
| 48 | grapheme.addImport("code_point", code_point); | 50 | grapheme.addImport("code_point", code_point); |
| 49 | grapheme.addAnonymousImport("gbp", .{ .root_source_file = gbp_gen_out }); | 51 | grapheme.addAnonymousImport("gbp", .{ .root_source_file = gbp_gen_out }); |
| 50 | 52 | ||
| 53 | // ASCII utilities | ||
| 54 | const ascii = b.addModule("ascii", .{ | ||
| 55 | .root_source_file = .{ .path = "src/ascii.zig" }, | ||
| 56 | .target = target, | ||
| 57 | .optimize = optimize, | ||
| 58 | }); | ||
| 59 | |||
| 60 | // Fixed pitch font display width | ||
| 51 | const display_width = b.addModule("display_width", .{ | 61 | const display_width = b.addModule("display_width", .{ |
| 52 | .root_source_file = .{ .path = "src/display_width.zig" }, | 62 | .root_source_file = .{ .path = "src/display_width.zig" }, |
| 53 | .target = target, | 63 | .target = target, |
| 54 | .optimize = optimize, | 64 | .optimize = optimize, |
| 55 | }); | 65 | }); |
| 66 | display_width.addImport("ascii", ascii); | ||
| 56 | display_width.addImport("code_point", code_point); | 67 | display_width.addImport("code_point", code_point); |
| 57 | display_width.addImport("grapheme", grapheme); | 68 | display_width.addImport("grapheme", grapheme); |
| 58 | display_width.addAnonymousImport("dwp", .{ .root_source_file = dwp_gen_out }); | 69 | display_width.addAnonymousImport("dwp", .{ .root_source_file = dwp_gen_out }); |
| @@ -79,10 +90,11 @@ pub fn build(b: *std.Build) void { | |||
| 79 | 90 | ||
| 80 | // Tests | 91 | // Tests |
| 81 | const exe_unit_tests = b.addTest(.{ | 92 | const exe_unit_tests = b.addTest(.{ |
| 82 | .root_source_file = .{ .path = "src/display_width.zig" }, | 93 | .root_source_file = .{ .path = "src/grapheme.zig" }, |
| 83 | .target = target, | 94 | .target = target, |
| 84 | .optimize = optimize, | 95 | .optimize = optimize, |
| 85 | }); | 96 | }); |
| 97 | exe_unit_tests.root_module.addImport("ascii", ascii); | ||
| 86 | exe_unit_tests.root_module.addImport("code_point", code_point); | 98 | exe_unit_tests.root_module.addImport("code_point", code_point); |
| 87 | exe_unit_tests.root_module.addImport("grapheme", grapheme); | 99 | exe_unit_tests.root_module.addImport("grapheme", grapheme); |
| 88 | exe_unit_tests.root_module.addAnonymousImport("gbp", .{ .root_source_file = gbp_gen_out }); | 100 | exe_unit_tests.root_module.addAnonymousImport("gbp", .{ .root_source_file = gbp_gen_out }); |