authorgravatar for kcbanner@gmail.comCasey Banner <kcbanner@gmail.com> 2023-04-15 22:20:34-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-04-17 13:46:14-07:00
log40e1fca34b2c0d2cde130fd17331a2935c473644
tree3cd58ce78e853209a78e7d3a08b70aab37d9d909
parent3cd19dd89743ae55329f7f5573db4750f902e830

compilation: fix non-zig compilations not using CacheMode.whole

main: consume --debug-log argument even when logging is disabled

2 files changed, 2 insertions(+), 1 deletions(-)

src/Compilation.zig+1-1
......@@ -780,7 +780,7 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation {
780780 // compiler state, the second clause here can be removed so that incremental
781781 // cache mode is used for LLVM backend too. We need some fuzz testing before
782782 // that can be enabled.
783 const cache_mode = if (use_llvm and !options.disable_lld_caching)
783 const cache_mode = if ((use_llvm or options.main_pkg == null) and !options.disable_lld_caching)
784784 CacheMode.whole
785785 else
786786 options.cache_mode;
src/main.zig+1
......@@ -1161,6 +1161,7 @@ fn buildOutputType(
11611161 } else if (mem.eql(u8, arg, "--debug-log")) {
11621162 if (!build_options.enable_logging) {
11631163 std.log.warn("Zig was compiled without logging enabled (-Dlog). --debug-log has no effect.", .{});
1164 _ = args_iter.nextOrFatal();
11641165 } else {
11651166 try log_scopes.append(gpa, args_iter.nextOrFatal());
11661167 }