From 2bbbdf7433cef151128f06b3c32dcd5a323d638c Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 15 Oct 2024 09:45:51 -0700 Subject: [PATCH] build: strip symbols from release builds This significantly reduces the size of the binary. --- build.zig | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build.zig b/build.zig index 25b5e5453..aa7bd54bd 100644 --- a/build.zig +++ b/build.zig @@ -237,6 +237,11 @@ pub fn build(b: *std.Build) !void { .root_source_file = b.path("src/main.zig"), .target = target, .optimize = optimize, + .strip = switch (optimize) { + .Debug => false, + .ReleaseSafe => false, + .ReleaseFast, .ReleaseSmall => true, + }, }) else null; // Exe