From fda6d44778f3faf53c66945a0db65be68113416f Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 13 Sep 2022 14:10:13 -0700 Subject: [PATCH] zig cc: do not enable the cache for link operations This commit makes `zig cc` match the equivalent behavior of `zig build-exe` with regards to caching. That is - it will cache individual .c to .o compilations (with the usual exceptions), but will always repeat the linking process so that incremental linking has a chance to happen. Perhaps a future enhancement will provide a way to get the old behavior, but I suspect this new behavior will be preferred by everyone, because it is closer to what C compilers do. Note that the old behavior can be obtained by switching to `zig build-exe` instead of `zig cc` and using the `--enable-cache` parameter. Closes #12317 --- src/main.zig | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main.zig b/src/main.zig index aaea682c7b..d5a3bce82d 100644 --- a/src/main.zig +++ b/src/main.zig @@ -2110,7 +2110,6 @@ fn buildOutputType( .link => { output_mode = if (is_shared_lib) .Lib else .Exe; emit_bin = if (out_path) |p| .{ .yes = p } else EmitBin.yes_a_out; - enable_cache = true; if (emit_llvm) { fatal("-emit-llvm cannot be used when linking", .{}); }