zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 420b7713d4e58bdb28992bca1a4de108317cfd31 (tree)
parent a4380a30f5aeafd03e909164b28550e5960500f9
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Tue, 27 Feb 2024 17:20:25 -0700

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:
Msrc/main.zig | 3+++
1 file changed, 3 insertions(+), 0 deletions(-)

diff --git 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,