authorgravatar for mason@gamesbymason.comMason Remaley <mason@gamesbymason.com> 2026-06-09 15:33:35-07:00
committergravatar for mason@gamesbymason.comMason Remaley <mason@gamesbymason.com> 2026-06-09 15:35:24-07:00
log431092fa612ca193cff56fd3430ac037ff70102b
treeb55599988e630cc97094445728862f9b149c8d81
parent1f43e049d0d46c14ce5d598f1b6587d2c043b82c

Adds a compile step option to toggle incremental compilation


4 files changed, 10 insertions(+), 2 deletions(-)

lib/compiler/Maker/Step/Compile.zig+1-1
......@@ -861,7 +861,7 @@ fn lowerZigArgs(
861861 "--error-limit", try allocPrint(arena, "{d}", .{err_limit}),
862862 };
863863
864 try addFlag(gpa, zig_args, "incremental", graph.incremental);
864 try addFlag(gpa, zig_args, "incremental", conf_comp.flags4.incremental.toBool() orelse graph.incremental);
865865
866866 try zig_args.append(gpa, "--listen=-");
867867
lib/compiler/configurer.zig+1
......@@ -797,6 +797,7 @@ fn serialize(b: *std.Build, wc: *Configuration.Wip, writer: *Io.Writer) !void {
797797 .generated_llvm_bc = c.generated_llvm_bc != .none,
798798 .generated_llvm_ir = c.generated_llvm_ir != .none,
799799 .generated_h = c.generated_h != .none,
800 .incremental = .init(c.incremental),
800801 },
801802 .root_module = try s.addModule(c.root_module),
802803 .root_name = try wc.addString(c.name),
lib/std/Build/Configuration.zig+2-1
......@@ -1016,7 +1016,8 @@ pub const Step = extern struct {
10161016 generated_llvm_bc: bool,
10171017 generated_llvm_ir: bool,
10181018 generated_h: bool,
1019 _: u9 = 0,
1019 incremental: DefaultingBool,
1020 _: u7 = 0,
10201021 };
10211022
10221023 pub fn isDynamicLibrary(compile: *const Compile) bool {
lib/std/Build/Step/Compile.zig+6
......@@ -234,6 +234,12 @@ is_linking_libcpp: bool = false,
234234/// builtin fuzzer, see the `fuzz` flag in `Module`.
235235sanitize_coverage_trace_pc_guard: ?bool = null,
236236
237/// Enable or disable incremental compilation.
238///
239/// Incremental compilation reduces compile time by mutating an existing build artifact. Non-
240/// incremental compilation is slower but preserves previous build artifacts.
241incremental: ?bool = null,
242
237243emit_directory: Configuration.OptionalGeneratedFileIndex = .none,
238244generated_docs: Configuration.OptionalGeneratedFileIndex = .none,
239245generated_asm: Configuration.OptionalGeneratedFileIndex = .none,