Skip to content

Commit 44b105a

Browse files
committed
stage2: make --debug-log work by default for debug builds
can be disabled with `-Dlog=false`
1 parent d3e40b0 commit 44b105a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

build.zig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,8 @@ pub fn build(b: *Builder) !void {
221221
test_stage2.linkLibC();
222222
}
223223

224-
const enable_logging = b.option(bool, "log", "Whether to enable logging") orelse false;
224+
const is_debug = mode == .Debug;
225+
const enable_logging = b.option(bool, "log", "Enable debug logging with --debug-log") orelse is_debug;
225226
const enable_link_snapshots = b.option(bool, "link-snapshot", "Whether to enable linker state snapshots") orelse false;
226227

227228
const opt_version_string = b.option([]const u8, "version-string", "Override Zig version string. Default is to find out with git.");

0 commit comments

Comments
 (0)