aboutsummaryrefslogtreecommitdiff
path: root/src/main.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2024-02-27 17:20:25 -0700
committerAndrew Kelley <andrew@ziglang.org>2024-02-27 22:55:00 -0700
commit420b7713d4e58bdb28992bca1a4de108317cfd31 (patch)
treecfa11628327ae3379e3096a89fd74a908d4363e3 /src/main.zig
parenta4380a30f5aeafd03e909164b28550e5960500f9 (diff)
downloadzig-420b7713d4e58bdb28992bca1a4de108317cfd31.tar.gz
zig-420b7713d4e58bdb28992bca1a4de108317cfd31.zip
CLI: strip lazy built commands by default
Saves a lot of time since we use -OReleaseFast. Disabled when ZIG_DEBUG_CMD=1 is passed.
Diffstat (limited to 'src/main.zig')
-rw-r--r--src/main.zig3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main.zig b/src/main.zig
index c9daa7eefe..9da48ba69c 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -5557,6 +5557,7 @@ fn jitCmd(
.Debug
else
.ReleaseFast;
+ const strip = optimize_mode != .Debug;
const override_lib_dir: ?[]const u8 = try EnvVar.ZIG_LIB_DIR.get(arena);
const override_global_cache_dir: ?[]const u8 = try EnvVar.ZIG_GLOBAL_CACHE_DIR.get(arena);
@@ -5599,6 +5600,7 @@ fn jitCmd(
const config = try Compilation.Config.resolve(.{
.output_mode = .Exe,
+ .root_strip = strip,
.root_optimize_mode = optimize_mode,
.resolved_target = resolved_target,
.have_zcu = true,
@@ -5614,6 +5616,7 @@ fn jitCmd(
.inherited = .{
.resolved_target = resolved_target,
.optimize_mode = optimize_mode,
+ .strip = strip,
},
.global = config,
.parent = null,