mirror of
https://github.com/ziglang/zig.git
synced 2025-12-24 23:23:07 +00:00
stage2: Warn when using --debug-log without logging enabled
A warning is emitted when using the debug option --debug-log when the compiler was not compiled using the build option -Dlog. Additionnaly, the scopes are not added to log_scopes as they have no effect.
This commit is contained in:
parent
4e9894cfc4
commit
f69305f865
@ -841,7 +841,11 @@ fn buildOutputType(
|
||||
} else if (mem.eql(u8, arg, "--debug-log")) {
|
||||
if (i + 1 >= args.len) fatal("expected parameter after {s}", .{arg});
|
||||
i += 1;
|
||||
try log_scopes.append(gpa, args[i]);
|
||||
if (!build_options.enable_logging) {
|
||||
std.log.warn("Zig was compiled without logging enabled (-Dlog). --debug-log has no effect.", .{});
|
||||
} else {
|
||||
try log_scopes.append(gpa, args[i]);
|
||||
}
|
||||
} else if (mem.eql(u8, arg, "-fcompiler-rt")) {
|
||||
want_compiler_rt = true;
|
||||
} else if (mem.eql(u8, arg, "-fno-compiler-rt")) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user