summaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
authorGravatar Jose Colon Rodriguez2024-02-27 18:04:32 -0400
committerGravatar Jose Colon Rodriguez2024-02-27 18:04:32 -0400
commitecd9c2277de17e24fa26aefee955caa10b5b990c (patch)
treeb76f3e2b9886456f61b0001f4dcae15d00a76856 /build.zig
parentNormalizer 2x faster than Ziglyph; Uses 2x memory (diff)
downloadzg-ecd9c2277de17e24fa26aefee955caa10b5b990c.tar.gz
zg-ecd9c2277de17e24fa26aefee955caa10b5b990c.tar.xz
zg-ecd9c2277de17e24fa26aefee955caa10b5b990c.zip
General Category with GenCatData
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig22
1 files changed, 20 insertions, 2 deletions
diff --git a/build.zig b/build.zig
index 7e41a9a..b10b0d3 100644
--- a/build.zig
+++ b/build.zig
@@ -79,6 +79,15 @@ pub fn build(b: *std.Build) void {
79 const run_ccc_gen_exe = b.addRunArtifact(ccc_gen_exe); 79 const run_ccc_gen_exe = b.addRunArtifact(ccc_gen_exe);
80 const ccc_gen_out = run_ccc_gen_exe.addOutputFileArg("ccc.bin.z"); 80 const ccc_gen_out = run_ccc_gen_exe.addOutputFileArg("ccc.bin.z");
81 81
82 const gencat_gen_exe = b.addExecutable(.{
83 .name = "gencat",
84 .root_source_file = .{ .path = "codegen/gencat.zig" },
85 .target = b.host,
86 .optimize = .Debug,
87 });
88 const run_gencat_gen_exe = b.addRunArtifact(gencat_gen_exe);
89 const gencat_gen_out = run_gencat_gen_exe.addOutputFileArg("gencat.bin.z");
90
82 // Modules we provide 91 // Modules we provide
83 // Code points 92 // Code points
84 const code_point = b.addModule("code_point", .{ 93 const code_point = b.addModule("code_point", .{
@@ -185,6 +194,14 @@ pub fn build(b: *std.Build) void {
185 norm.addImport("ziglyph", ziglyph.module("ziglyph")); 194 norm.addImport("ziglyph", ziglyph.module("ziglyph"));
186 norm.addImport("NormData", norm_data); 195 norm.addImport("NormData", norm_data);
187 196
197 // General Category
198 const gencat_data = b.createModule(.{
199 .root_source_file = .{ .path = "src/GenCatData.zig" },
200 .target = target,
201 .optimize = optimize,
202 });
203 gencat_data.addAnonymousImport("gencat", .{ .root_source_file = gencat_gen_out });
204
188 // Benchmark rig 205 // Benchmark rig
189 const exe = b.addExecutable(.{ 206 const exe = b.addExecutable(.{
190 .name = "zg", 207 .name = "zg",
@@ -194,10 +211,11 @@ pub fn build(b: *std.Build) void {
194 }); 211 });
195 // exe.root_module.addImport("ziglyph", ziglyph.module("ziglyph")); 212 // exe.root_module.addImport("ziglyph", ziglyph.module("ziglyph"));
196 // exe.root_module.addImport("ascii", ascii); 213 // exe.root_module.addImport("ascii", ascii);
197 // exe.root_module.addImport("code_point", code_point); 214 exe.root_module.addImport("code_point", code_point);
198 // exe.root_module.addImport("grapheme", grapheme); 215 // exe.root_module.addImport("grapheme", grapheme);
199 // exe.root_module.addImport("DisplayWidth", display_width); 216 // exe.root_module.addImport("DisplayWidth", display_width);
200 exe.root_module.addImport("Normalizer", norm); 217 // exe.root_module.addImport("Normalizer", norm);
218 exe.root_module.addImport("GenCatData", gencat_data);
201 b.installArtifact(exe); 219 b.installArtifact(exe);
202 220
203 const run_cmd = b.addRunArtifact(exe); 221 const run_cmd = b.addRunArtifact(exe);