From 6c68f38b8cc76288dcc871b6acc5e9470385d2a7 Mon Sep 17 00:00:00 2001 From: Meghan Denny Date: Thu, 23 Nov 2023 21:13:55 -0800 Subject: [PATCH] build.zig: add a -Doption --- build.zig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.zig b/build.zig index c0b7e8442a9653977c7173ca71af2aba65f7afb4..7a5ed9ded30b96f25138e891071828039465fe1d 100644 --- a/build.zig +++ b/build.zig @@ -11,12 +11,14 @@ pub fn build(b: *std.build.Builder) void { const exe_name = b.fmt("{s}{s}", .{ "zigmod", if (use_full_name) with_arch_os else "" }); const exe = b.addExecutable(.{ .name = exe_name, .root_source_file = .{ .path = "src/main.zig" }, .target = target, .optimize = mode }); const tag = b.option(string, "tag", "") orelse "dev"; + const strip = b.option(bool, "strip", "Build without debug info.") orelse false; const exe_options = b.addOptions(); exe.addOptions("build_options", exe_options); exe_options.addOption(string, "version", tag); deps.addAllTo(exe); + exe.strip = strip; b.installArtifact(exe); const run_cmd = b.addRunArtifact(exe); -- 2.54.0