fix bench and unicode-test builds

This commit is contained in:
Jacob Sandlund
2025-07-07 00:53:05 -04:00
parent 265f2aa82f
commit 5f80ba7b2c
3 changed files with 5 additions and 10 deletions

View File

@ -36,15 +36,6 @@ pub fn init(b: *std.Build, cfg: *const Config, deps: *const SharedDeps) !Unicode
exe.root_module.addImport("ziglyph", dep.module("ziglyph"));
}
// Add zg dependencies used just for unicode-test
if (b.lazyDependency("zg", .{
.target = cfg.target,
.optimize = cfg.optimize,
})) |dep| {
exe.root_module.addImport("DisplayWidth", dep.module("DisplayWidth"));
exe.root_module.addImport("Graphemes", dep.module("Graphemes"));
}
// Add the old version of the unicode tables
const old_unicode_tables = try UnicodeTables.init(b);
old_unicode_tables.run.addArg("old");

View File

@ -415,6 +415,10 @@ pub fn add(
.target = target,
.optimize = optimize,
})) |dep| {
if (self.config.emit_bench or self.config.emit_unicode_test) {
step.root_module.addImport("Graphemes", dep.module("Graphemes"));
step.root_module.addImport("DisplayWidth", dep.module("DisplayWidth"));
}
step.root_module.addImport("CaseFolding", dep.module("CaseFolding"));
step.root_module.addImport("Emoji", dep.module("Emoji"));
step.root_module.addImport("GeneralCategories", dep.module("GeneralCategories"));

View File

@ -51,7 +51,7 @@ pub const GlobalState = struct {
// defer {
// const end = std.time.Instant.now() catch unreachable;
// // "[updateFrame critical time] <START us>\t<TIME_TAKEN us>"
// std.log.err("[global init time] start={}us duration={}ns", .{ start_micro, end.since(start) / std.time.ns_per_us });
// std.log.err("[global init time] start={}us duration={}us", .{ start_micro, end.since(start) / std.time.ns_per_us });
// }
// Initialize ourself to nothing so we don't have any extra state.