warn if the binary is a debug build

This commit is contained in:
Mitchell Hashimoto
2023-08-09 15:18:22 -07:00
parent 7b33ee6b71
commit 2704b54bc5

View File

@ -22,6 +22,12 @@ const Ghostty = @import("main_c.zig").Ghostty;
pub var state: GlobalState = undefined; pub var state: GlobalState = undefined;
pub fn main() !void { pub fn main() !void {
if (comptime builtin.mode == .Debug) {
std.log.warn("This is a debug build. Performance will be very poor.", .{});
std.log.warn("You should only use a debug build for developing Ghostty.", .{});
std.log.warn("Otherwise, please rebuild in a release mode.", .{});
}
state.init(); state.init();
defer state.deinit(); defer state.deinit();
const alloc = state.alloc; const alloc = state.alloc;