build: strip symbols from release builds

This significantly reduces the size of the binary.
This commit is contained in:
Mitchell Hashimoto
2024-10-15 09:45:51 -07:00
parent 4c18f1bf4b
commit 2bbbdf7433

View File

@ -237,6 +237,11 @@ 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 = switch (optimize) {
.Debug => false,
.ReleaseSafe => false,
.ReleaseFast, .ReleaseSmall => true,
},
}) else null; }) else null;
// Exe // Exe