move strip switch behind option

This commit is contained in:
Jan200101
2024-12-31 12:06:45 +01:00
parent c87e3e98a3
commit 061a730dd3

View File

@ -162,7 +162,11 @@ pub fn build(b: *std.Build) !void {
bool, bool,
"strip", "strip",
"Strip the final executable. Default true for fast and small releases", "Strip the final executable. Default true for fast and small releases",
) orelse null; ) orelse switch (optimize) {
.Debug => false,
.ReleaseSafe => false,
.ReleaseFast, .ReleaseSmall => true,
};
const conformance = b.option( const conformance = b.option(
[]const u8, []const u8,
@ -348,11 +352,7 @@ pub fn build(b: *std.Build) !void {
.root_source_file = b.path("src/main.zig"), .root_source_file = b.path("src/main.zig"),
.target = target, .target = target,
.optimize = optimize, .optimize = optimize,
.strip = strip orelse switch (optimize) { .strip = strip,
.Debug => false,
.ReleaseSafe => false,
.ReleaseFast, .ReleaseSmall => true,
},
}) else null; }) else null;
// Exe // Exe