diff options
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 38 |
1 files changed, 31 insertions, 7 deletions
| @@ -34,6 +34,15 @@ pub fn build(b: *std.Build) void { | |||
| 34 | const dwp_gen_out = run_dwp_gen_exe.addOutputFileArg("dwp.bin.z"); | 34 | const dwp_gen_out = run_dwp_gen_exe.addOutputFileArg("dwp.bin.z"); |
| 35 | 35 | ||
| 36 | // Normalization properties | 36 | // Normalization properties |
| 37 | const canon_gen_exe = b.addExecutable(.{ | ||
| 38 | .name = "canon", | ||
| 39 | .root_source_file = .{ .path = "codegen/canon.zig" }, | ||
| 40 | .target = b.host, | ||
| 41 | .optimize = .Debug, | ||
| 42 | }); | ||
| 43 | const run_canon_gen_exe = b.addRunArtifact(canon_gen_exe); | ||
| 44 | const canon_gen_out = run_canon_gen_exe.addOutputFileArg("canon.bin.z"); | ||
| 45 | |||
| 37 | const ccc_gen_exe = b.addExecutable(.{ | 46 | const ccc_gen_exe = b.addExecutable(.{ |
| 38 | .name = "ccc", | 47 | .name = "ccc", |
| 39 | .root_source_file = .{ .path = "codegen/ccc.zig" }, | 48 | .root_source_file = .{ .path = "codegen/ccc.zig" }, |
| @@ -101,6 +110,21 @@ pub fn build(b: *std.Build) void { | |||
| 101 | }); | 110 | }); |
| 102 | ccc_data.addAnonymousImport("ccc", .{ .root_source_file = ccc_gen_out }); | 111 | ccc_data.addAnonymousImport("ccc", .{ .root_source_file = ccc_gen_out }); |
| 103 | 112 | ||
| 113 | const canon_data = b.createModule(.{ | ||
| 114 | .root_source_file = .{ .path = "src/Canonical.zig" }, | ||
| 115 | .target = target, | ||
| 116 | .optimize = optimize, | ||
| 117 | }); | ||
| 118 | canon_data.addAnonymousImport("canon", .{ .root_source_file = canon_gen_out }); | ||
| 119 | |||
| 120 | const norm_data = b.createModule(.{ | ||
| 121 | .root_source_file = .{ .path = "src/NormData.zig" }, | ||
| 122 | .target = target, | ||
| 123 | .optimize = optimize, | ||
| 124 | }); | ||
| 125 | norm_data.addImport("CanonicalData", canon_data); | ||
| 126 | norm_data.addImport("CombiningClassData", ccc_data); | ||
| 127 | |||
| 104 | const norm = b.addModule("Normalizer", .{ | 128 | const norm = b.addModule("Normalizer", .{ |
| 105 | .root_source_file = .{ .path = "src/Normalizer.zig" }, | 129 | .root_source_file = .{ .path = "src/Normalizer.zig" }, |
| 106 | .target = target, | 130 | .target = target, |
| @@ -108,7 +132,7 @@ pub fn build(b: *std.Build) void { | |||
| 108 | }); | 132 | }); |
| 109 | norm.addImport("code_point", code_point); | 133 | norm.addImport("code_point", code_point); |
| 110 | norm.addImport("ziglyph", ziglyph.module("ziglyph")); | 134 | norm.addImport("ziglyph", ziglyph.module("ziglyph")); |
| 111 | norm.addImport("CombiningClassData", ccc_data); | 135 | norm.addImport("NormData", norm_data); |
| 112 | 136 | ||
| 113 | // Benchmark rig | 137 | // Benchmark rig |
| 114 | const exe = b.addExecutable(.{ | 138 | const exe = b.addExecutable(.{ |
| @@ -134,18 +158,18 @@ pub fn build(b: *std.Build) void { | |||
| 134 | 158 | ||
| 135 | // Tests | 159 | // Tests |
| 136 | const exe_unit_tests = b.addTest(.{ | 160 | const exe_unit_tests = b.addTest(.{ |
| 137 | .root_source_file = .{ .path = "src/DisplayWidth.zig" }, | 161 | .root_source_file = .{ .path = "src/Normalizer.zig" }, |
| 138 | .target = target, | 162 | .target = target, |
| 139 | .optimize = optimize, | 163 | .optimize = optimize, |
| 140 | }); | 164 | }); |
| 141 | exe_unit_tests.root_module.addImport("ascii", ascii); | 165 | // exe_unit_tests.root_module.addImport("ascii", ascii); |
| 142 | exe_unit_tests.root_module.addImport("code_point", code_point); | 166 | exe_unit_tests.root_module.addImport("code_point", code_point); |
| 143 | // exe_unit_tests.root_module.addImport("GraphemeData", grapheme_data); | 167 | // exe_unit_tests.root_module.addImport("GraphemeData", grapheme_data); |
| 144 | exe_unit_tests.root_module.addImport("grapheme", grapheme); | 168 | // exe_unit_tests.root_module.addImport("grapheme", grapheme); |
| 145 | // exe_unit_tests.root_module.addImport("ziglyph", ziglyph.module("ziglyph")); | 169 | exe_unit_tests.root_module.addImport("ziglyph", ziglyph.module("ziglyph")); |
| 146 | // exe_unit_tests.root_module.addAnonymousImport("normp", .{ .root_source_file = normp_gen_out }); | 170 | // exe_unit_tests.root_module.addAnonymousImport("normp", .{ .root_source_file = normp_gen_out }); |
| 147 | exe_unit_tests.root_module.addImport("DisplayWidthData", dw_data); | 171 | // exe_unit_tests.root_module.addImport("DisplayWidthData", dw_data); |
| 148 | // exe_unit_tests.root_module.addImport("CombiningClassData", ccc_data); | 172 | exe_unit_tests.root_module.addImport("NormData", norm_data); |
| 149 | 173 | ||
| 150 | const run_exe_unit_tests = b.addRunArtifact(exe_unit_tests); | 174 | const run_exe_unit_tests = b.addRunArtifact(exe_unit_tests); |
| 151 | 175 | ||