| ... | @@ -5,11 +5,11 @@ const deps = @import("./deps.zig"); | ... | @@ -5,11 +5,11 @@ const deps = @import("./deps.zig"); |
| 5 | | 5 | |
| 6 | pub fn build(b: *std.build.Builder) void { | 6 | pub fn build(b: *std.build.Builder) void { |
| 7 | const target = b.standardTargetOptions(.{}); | 7 | const target = b.standardTargetOptions(.{}); |
| 8 | const optimize = b.standardOptimizeOption(.{}); | 8 | const mode = b.option(std.builtin.Mode, "mode", "") orelse .Debug; |
| 9 | const use_full_name = b.option(bool, "use-full-name", "") orelse false; | 9 | const use_full_name = b.option(bool, "use-full-name", "") orelse false; |
| 10 | const with_arch_os = b.fmt("-{s}-{s}", .{ @tagName(target.cpu_arch orelse builtin.cpu.arch), @tagName(target.os_tag orelse builtin.os.tag) }); | 10 | const with_arch_os = b.fmt("-{s}-{s}", .{ @tagName(target.cpu_arch orelse builtin.cpu.arch), @tagName(target.os_tag orelse builtin.os.tag) }); |
| 11 | const exe_name = b.fmt("{s}{s}", .{ "zigmod", if (use_full_name) with_arch_os else "" }); | 11 | const exe_name = b.fmt("{s}{s}", .{ "zigmod", if (use_full_name) with_arch_os else "" }); |
| 12 | const exe = b.addExecutable(.{ .name = exe_name, .root_source_file = .{ .path = "src/main.zig" }, .target = target, .optimize = optimize }); | 12 | const exe = b.addExecutable(.{ .name = exe_name, .root_source_file = .{ .path = "src/main.zig" }, .target = target, .optimize = mode }); |
| 13 | | 13 | |
| 14 | const exe_options = b.addOptions(); | 14 | const exe_options = b.addOptions(); |
| 15 | exe.addOptions("build_options", exe_options); | 15 | exe.addOptions("build_options", exe_options); |