diff --git a/build.zig b/build.zig index 4f743d382dd2914dd9e75495edd28eb32f99df0f..0b92690590f24f71cc810ffb77bab5db4b09828f 100644 --- a/build.zig +++ b/build.zig @@ -5,11 +5,11 @@ const deps = @import("./deps.zig"); pub fn build(b: *std.build.Builder) void { const target = b.standardTargetOptions(.{}); - const optimize = b.standardOptimizeOption(.{}); + const mode = b.option(std.builtin.Mode, "mode", "") orelse .Debug; const use_full_name = b.option(bool, "use-full-name", "") orelse false; const with_arch_os = b.fmt("-{s}-{s}", .{ @tagName(target.cpu_arch orelse builtin.cpu.arch), @tagName(target.os_tag orelse builtin.os.tag) }); 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 = optimize }); + const exe = b.addExecutable(.{ .name = exe_name, .root_source_file = .{ .path = "src/main.zig" }, .target = target, .optimize = mode }); const exe_options = b.addOptions(); exe.addOptions("build_options", exe_options);