aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorkcbanner <kcbanner@gmail.com>2023-04-15 22:20:34 -0400
committerAndrew Kelley <andrew@ziglang.org>2023-04-17 13:46:14 -0700
commit40e1fca34b2c0d2cde130fd17331a2935c473644 (patch)
tree3cd58ce78e853209a78e7d3a08b70aab37d9d909 /src
parent3cd19dd89743ae55329f7f5573db4750f902e830 (diff)
downloadzig-40e1fca34b2c0d2cde130fd17331a2935c473644.tar.gz
zig-40e1fca34b2c0d2cde130fd17331a2935c473644.zip
compilation: fix non-zig compilations not using CacheMode.whole
main: consume --debug-log argument even when logging is disabled
Diffstat (limited to 'src')
-rw-r--r--src/Compilation.zig2
-rw-r--r--src/main.zig1
2 files changed, 2 insertions, 1 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig
index 4c3e49fb52..063b5fd489 100644
--- a/src/Compilation.zig
+++ b/src/Compilation.zig
@@ -780,7 +780,7 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation {
// compiler state, the second clause here can be removed so that incremental
// cache mode is used for LLVM backend too. We need some fuzz testing before
// that can be enabled.
- const cache_mode = if (use_llvm and !options.disable_lld_caching)
+ const cache_mode = if ((use_llvm or options.main_pkg == null) and !options.disable_lld_caching)
CacheMode.whole
else
options.cache_mode;
diff --git a/src/main.zig b/src/main.zig
index e68c0e84c4..2bc4961cba 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -1161,6 +1161,7 @@ fn buildOutputType(
} else if (mem.eql(u8, arg, "--debug-log")) {
if (!build_options.enable_logging) {
std.log.warn("Zig was compiled without logging enabled (-Dlog). --debug-log has no effect.", .{});
+ _ = args_iter.nextOrFatal();
} else {
try log_scopes.append(gpa, args_iter.nextOrFatal());
}