Skip to content

Commit 5baea2d

Browse files
emil-edakra
authored andcommitted
Allow libghostty to have separate optimization settings from Ghostel module
When running profilers like Instruments to optimize Ghostel itself, you need debugging symbols and thus you need to build with -Doptimize=Debug. However, libghostty-vt is way too slow to get any useful data unless it's build in optimized release mode. This allows setting separate optimization levels.
1 parent 6437e5b commit 5baea2d

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

build.zig

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,17 @@ const vendored_emacs_module_dir = "vendor";
55
pub fn build(b: *std.Build) void {
66
const target = b.standardTargetOptions(.{});
77
const optimize = b.standardOptimizeOption(.{});
8+
const ghostty_optimize = b.option(
9+
std.builtin.OptimizeMode,
10+
"ghostty-optimize",
11+
"Optimization mode for the ghostty dependency (defaults to the main optimize option)",
12+
) orelse optimize;
813
const is_release = optimize != .Debug;
914
const target_os = target.result.os.tag;
1015
const emacs_module_dir = resolveEmacsModuleDir(b);
1116
const ghostty_dep = b.dependency("ghostty", .{
1217
.target = target,
13-
.optimize = optimize,
18+
.optimize = ghostty_optimize,
1419
.@"emit-lib-vt" = true,
1520
});
1621

0 commit comments

Comments
 (0)