aboutsummaryrefslogtreecommitdiff
path: root/lib/std/Build/Step/Compile.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2024-07-14 21:18:09 -0700
committerAndrew Kelley <andrew@ziglang.org>2024-07-14 21:18:09 -0700
commit716b128a24ffc44a8694f3d61e3d74b5297fd564 (patch)
treea3d37e3df26af301e478162229ebe2ea481cf2ee /lib/std/Build/Step/Compile.zig
parentabf895595189eb45df8c97f4029c58976815b450 (diff)
downloadzig-716b128a24ffc44a8694f3d61e3d74b5297fd564.tar.gz
zig-716b128a24ffc44a8694f3d61e3d74b5297fd564.zip
frontend: add -fincremental, -fno-incremental flag
Remove --debug-incremental This flag is also added to the build system. Importantly, this tells Compile step whether or not to keep the compiler running between rebuilds. It defaults off because it is currently crashing zirUpdateRefs.
Diffstat (limited to 'lib/std/Build/Step/Compile.zig')
-rw-r--r--lib/std/Build/Step/Compile.zig4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/std/Build/Step/Compile.zig b/lib/std/Build/Step/Compile.zig
index 9af6ace9c0..724656ce29 100644
--- a/lib/std/Build/Step/Compile.zig
+++ b/lib/std/Build/Step/Compile.zig
@@ -1679,6 +1679,8 @@ fn getZigArgs(compile: *Compile) ![][]const u8 {
b.fmt("{}", .{err_limit}),
});
+ try addFlag(&zig_args, "incremental", b.graph.incremental);
+
try zig_args.append("--listen=-");
// Windows has an argument length limit of 32,766 characters, macOS 262,144 and Linux
@@ -1750,7 +1752,7 @@ fn make(step: *Step, options: Step.MakeOptions) !void {
const maybe_output_bin_path = step.evalZigProcess(
zig_args,
options.progress_node,
- options.watch,
+ (b.graph.incremental == true) and options.watch,
) catch |err| switch (err) {
error.NeedCompileErrorCheck => {
assert(compile.expect_errors != null);