diff options
| author | 2024-03-27 21:52:02 -0400 | |
|---|---|---|
| committer | 2024-03-27 21:52:02 -0400 | |
| commit | 4ce891a8ce5336da39180964792110e131756cdd (patch) | |
| tree | b4ff0180157bb49e15d2c36f2cf0cdaab1a24535 /build.zig | |
| parent | Friendly general category methods (diff) | |
| download | zg-4ce891a8ce5336da39180964792110e131756cdd.tar.gz zg-4ce891a8ce5336da39180964792110e131756cdd.tar.xz zg-4ce891a8ce5336da39180964792110e131756cdd.zip | |
ScriptsData and made all Datas const
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 28 |
1 files changed, 23 insertions, 5 deletions
| @@ -137,6 +137,15 @@ pub fn build(b: *std.Build) void { | |||
| 137 | const run_lower_gen_exe = b.addRunArtifact(lower_gen_exe); | 137 | const run_lower_gen_exe = b.addRunArtifact(lower_gen_exe); |
| 138 | const lower_gen_out = run_lower_gen_exe.addOutputFileArg("lower.bin.z"); | 138 | const lower_gen_out = run_lower_gen_exe.addOutputFileArg("lower.bin.z"); |
| 139 | 139 | ||
| 140 | const scripts_gen_exe = b.addExecutable(.{ | ||
| 141 | .name = "scripts", | ||
| 142 | .root_source_file = .{ .path = "codegen/scripts.zig" }, | ||
| 143 | .target = b.host, | ||
| 144 | .optimize = .Debug, | ||
| 145 | }); | ||
| 146 | const run_scripts_gen_exe = b.addRunArtifact(scripts_gen_exe); | ||
| 147 | const scripts_gen_out = run_scripts_gen_exe.addOutputFileArg("scripts.bin.z"); | ||
| 148 | |||
| 140 | // Modules we provide | 149 | // Modules we provide |
| 141 | // Code points | 150 | // Code points |
| 142 | const code_point = b.addModule("code_point", .{ | 151 | const code_point = b.addModule("code_point", .{ |
| @@ -287,14 +296,22 @@ pub fn build(b: *std.Build) void { | |||
| 287 | case_data.addAnonymousImport("upper", .{ .root_source_file = upper_gen_out }); | 296 | case_data.addAnonymousImport("upper", .{ .root_source_file = upper_gen_out }); |
| 288 | case_data.addAnonymousImport("lower", .{ .root_source_file = lower_gen_out }); | 297 | case_data.addAnonymousImport("lower", .{ .root_source_file = lower_gen_out }); |
| 289 | 298 | ||
| 299 | // Scripts | ||
| 300 | const scripts_data = b.addModule("ScriptsData", .{ | ||
| 301 | .root_source_file = .{ .path = "src/ScriptsData.zig" }, | ||
| 302 | .target = target, | ||
| 303 | .optimize = optimize, | ||
| 304 | }); | ||
| 305 | scripts_data.addAnonymousImport("scripts", .{ .root_source_file = scripts_gen_out }); | ||
| 306 | |||
| 290 | // Tests | 307 | // Tests |
| 291 | const exe_unit_tests = b.addTest(.{ | 308 | const exe_unit_tests = b.addTest(.{ |
| 292 | .root_source_file = .{ .path = "src/CaseData.zig" }, | 309 | .root_source_file = .{ .path = "src/ScriptsData.zig" }, |
| 293 | .target = target, | 310 | .target = target, |
| 294 | .optimize = optimize, | 311 | .optimize = optimize, |
| 295 | }); | 312 | }); |
| 296 | // exe_unit_tests.root_module.addImport("ascii", ascii); | 313 | // exe_unit_tests.root_module.addImport("ascii", ascii); |
| 297 | exe_unit_tests.root_module.addImport("code_point", code_point); | 314 | // exe_unit_tests.root_module.addImport("code_point", code_point); |
| 298 | // exe_unit_tests.root_module.addImport("GraphemeData", grapheme_data); | 315 | // exe_unit_tests.root_module.addImport("GraphemeData", grapheme_data); |
| 299 | // exe_unit_tests.root_module.addImport("grapheme", grapheme); | 316 | // exe_unit_tests.root_module.addImport("grapheme", grapheme); |
| 300 | // exe_unit_tests.root_module.addImport("ziglyph", ziglyph.module("ziglyph")); | 317 | // exe_unit_tests.root_module.addImport("ziglyph", ziglyph.module("ziglyph")); |
| @@ -304,9 +321,10 @@ pub fn build(b: *std.Build) void { | |||
| 304 | // exe_unit_tests.root_module.addImport("Normalize", norm); | 321 | // exe_unit_tests.root_module.addImport("Normalize", norm); |
| 305 | // exe_unit_tests.root_module.addImport("FoldData", fold_data); | 322 | // exe_unit_tests.root_module.addImport("FoldData", fold_data); |
| 306 | // exe_unit_tests.root_module.addAnonymousImport("numeric", .{ .root_source_file = num_gen_out }); | 323 | // exe_unit_tests.root_module.addAnonymousImport("numeric", .{ .root_source_file = num_gen_out }); |
| 307 | exe_unit_tests.root_module.addAnonymousImport("case_prop", .{ .root_source_file = case_prop_gen_out }); | 324 | // exe_unit_tests.root_module.addAnonymousImport("case_prop", .{ .root_source_file = case_prop_gen_out }); |
| 308 | exe_unit_tests.root_module.addAnonymousImport("upper", .{ .root_source_file = upper_gen_out }); | 325 | // exe_unit_tests.root_module.addAnonymousImport("upper", .{ .root_source_file = upper_gen_out }); |
| 309 | exe_unit_tests.root_module.addAnonymousImport("lower", .{ .root_source_file = lower_gen_out }); | 326 | // exe_unit_tests.root_module.addAnonymousImport("lower", .{ .root_source_file = lower_gen_out }); |
| 327 | exe_unit_tests.root_module.addAnonymousImport("scripts", .{ .root_source_file = scripts_gen_out }); | ||
| 310 | // exe_unit_tests.filter = "nfd !ASCII"; | 328 | // exe_unit_tests.filter = "nfd !ASCII"; |
| 311 | 329 | ||
| 312 | const run_exe_unit_tests = b.addRunArtifact(exe_unit_tests); | 330 | const run_exe_unit_tests = b.addRunArtifact(exe_unit_tests); |