mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 04:48:20 +00:00
introduce ZIG_DEBUG_CMD to choose debug mode
for lazily built commands such as `zig fmt` and `zig reduce`. Useful if you want to test a patch to them.
This commit is contained in:
parent
1a01151a4e
commit
97f2a8b5cb
@ -153,6 +153,7 @@ pub const EnvVar = enum {
|
||||
ZIG_VERBOSE_LINK,
|
||||
ZIG_VERBOSE_CC,
|
||||
ZIG_BTRFS_WORKAROUND,
|
||||
ZIG_DEBUG_CMD,
|
||||
CC,
|
||||
NO_COLOR,
|
||||
XDG_CACHE_HOME,
|
||||
|
||||
@ -5735,6 +5735,10 @@ fn jitCmd(
|
||||
fatal("unable to find self exe path: {s}", .{@errorName(err)});
|
||||
};
|
||||
|
||||
const optimize_mode: std.builtin.OptimizeMode = if (EnvVar.ZIG_DEBUG_CMD.isSet())
|
||||
.Debug
|
||||
else
|
||||
.ReleaseFast;
|
||||
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);
|
||||
|
||||
@ -5777,7 +5781,7 @@ fn jitCmd(
|
||||
|
||||
const config = try Compilation.Config.resolve(.{
|
||||
.output_mode = .Exe,
|
||||
.root_optimize_mode = .ReleaseFast,
|
||||
.root_optimize_mode = optimize_mode,
|
||||
.resolved_target = resolved_target,
|
||||
.have_zcu = true,
|
||||
.emit_bin = true,
|
||||
@ -5791,7 +5795,7 @@ fn jitCmd(
|
||||
.cc_argv = &.{},
|
||||
.inherited = .{
|
||||
.resolved_target = resolved_target,
|
||||
.optimize_mode = .ReleaseFast,
|
||||
.optimize_mode = optimize_mode,
|
||||
},
|
||||
.global = config,
|
||||
.parent = null,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user