diff options
| author | 2024-02-18 13:28:09 -0400 | |
|---|---|---|
| committer | 2024-02-18 13:28:09 -0400 | |
| commit | e2f2e8f25e1b4507d502bea3900031c16eb6a52d (patch) | |
| tree | 8a2cab5d8166cb7f4cafa9fe9e3a1fd991bfce85 /build.zig | |
| parent | Grapheme -> grapheme (diff) | |
| download | zg-e2f2e8f25e1b4507d502bea3900031c16eb6a52d.tar.gz zg-e2f2e8f25e1b4507d502bea3900031c16eb6a52d.tar.xz zg-e2f2e8f25e1b4507d502bea3900031c16eb6a52d.zip | |
Added cjk build option to set ambiguous width to 2 at build time
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 7 |
1 files changed, 7 insertions, 0 deletions
| @@ -8,6 +8,7 @@ pub fn build(b: *std.Build) void { | |||
| 8 | const ziglyph = b.dependency("ziglyph", .{}); | 8 | const ziglyph = b.dependency("ziglyph", .{}); |
| 9 | 9 | ||
| 10 | // Code generation | 10 | // Code generation |
| 11 | // Grapheme break | ||
| 11 | const gbp_gen_exe = b.addExecutable(.{ | 12 | const gbp_gen_exe = b.addExecutable(.{ |
| 12 | .name = "gbp", | 13 | .name = "gbp", |
| 13 | .root_source_file = .{ .path = "codegen/gbp.zig" }, | 14 | .root_source_file = .{ .path = "codegen/gbp.zig" }, |
| @@ -17,12 +18,18 @@ pub fn build(b: *std.Build) void { | |||
| 17 | const run_gbp_gen_exe = b.addRunArtifact(gbp_gen_exe); | 18 | const run_gbp_gen_exe = b.addRunArtifact(gbp_gen_exe); |
| 18 | const gbp_gen_out = run_gbp_gen_exe.addOutputFileArg("gbp.zig"); | 19 | const gbp_gen_out = run_gbp_gen_exe.addOutputFileArg("gbp.zig"); |
| 19 | 20 | ||
| 21 | // Display width | ||
| 22 | const cjk = b.option(bool, "cjk", "Ambiguouse code points are wide (display width: 2).") orelse false; | ||
| 23 | const options = b.addOptions(); | ||
| 24 | options.addOption(bool, "cjk", cjk); | ||
| 25 | |||
| 20 | const dwp_gen_exe = b.addExecutable(.{ | 26 | const dwp_gen_exe = b.addExecutable(.{ |
| 21 | .name = "dwp", | 27 | .name = "dwp", |
| 22 | .root_source_file = .{ .path = "codegen/dwp.zig" }, | 28 | .root_source_file = .{ .path = "codegen/dwp.zig" }, |
| 23 | .target = b.host, | 29 | .target = b.host, |
| 24 | .optimize = .Debug, | 30 | .optimize = .Debug, |
| 25 | }); | 31 | }); |
| 32 | dwp_gen_exe.root_module.addOptions("options", options); | ||
| 26 | const run_dwp_gen_exe = b.addRunArtifact(dwp_gen_exe); | 33 | const run_dwp_gen_exe = b.addRunArtifact(dwp_gen_exe); |
| 27 | const dwp_gen_out = run_dwp_gen_exe.addOutputFileArg("dwp.zig"); | 34 | const dwp_gen_out = run_dwp_gen_exe.addOutputFileArg("dwp.zig"); |
| 28 | 35 | ||