From 5f80ba7b2cf833dae7f3996975894925c85bf515 Mon Sep 17 00:00:00 2001 From: Jacob Sandlund Date: Mon, 7 Jul 2025 00:53:05 -0400 Subject: [PATCH] fix bench and unicode-test builds --- src/build/GhosttyUnicodeTest.zig | 9 --------- src/build/SharedDeps.zig | 4 ++++ src/global.zig | 2 +- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/build/GhosttyUnicodeTest.zig b/src/build/GhosttyUnicodeTest.zig index 4063c40ad..8421e9fae 100644 --- a/src/build/GhosttyUnicodeTest.zig +++ b/src/build/GhosttyUnicodeTest.zig @@ -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"); diff --git a/src/build/SharedDeps.zig b/src/build/SharedDeps.zig index 544be5c68..367baf5d2 100644 --- a/src/build/SharedDeps.zig +++ b/src/build/SharedDeps.zig @@ -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")); diff --git a/src/global.zig b/src/global.zig index 668d2faec..ff84f3e9e 100644 --- a/src/global.zig +++ b/src/global.zig @@ -51,7 +51,7 @@ pub const GlobalState = struct { // defer { // const end = std.time.Instant.now() catch unreachable; // // "[updateFrame critical time] \t" - // 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.