| ... | @@ -11,12 +11,14 @@ pub fn build(b: *std.build.Builder) void { | ... | @@ -11,12 +11,14 @@ pub fn build(b: *std.build.Builder) void { |
| 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 = mode }); | 12 | const exe = b.addExecutable(.{ .name = exe_name, .root_source_file = .{ .path = "src/main.zig" }, .target = target, .optimize = mode }); |
| 13 | const tag = b.option(string, "tag", "") orelse "dev"; | 13 | const tag = b.option(string, "tag", "") orelse "dev"; |
| | 14 | const strip = b.option(bool, "strip", "Build without debug info.") orelse false; |
| 14 | | 15 | |
| 15 | const exe_options = b.addOptions(); | 16 | const exe_options = b.addOptions(); |
| 16 | exe.addOptions("build_options", exe_options); | 17 | exe.addOptions("build_options", exe_options); |
| 17 | exe_options.addOption(string, "version", tag); | 18 | exe_options.addOption(string, "version", tag); |
| 18 | | 19 | |
| 19 | deps.addAllTo(exe); | 20 | deps.addAllTo(exe); |
| | 21 | exe.strip = strip; |
| 20 | b.installArtifact(exe); | 22 | b.installArtifact(exe); |
| 21 | | 23 | |
| 22 | const run_cmd = b.addRunArtifact(exe); | 24 | const run_cmd = b.addRunArtifact(exe); |