Skip to content

Commit

Permalink
build.zig: move -Dtag option declaration out with other options
Browse files Browse the repository at this point in the history
  • Loading branch information
nektro committed Nov 24, 2023
1 parent 8fb6d24 commit 5403d1a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ pub fn build(b: *std.build.Builder) void {
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 = mode });
const tag = b.option(string, "tag", "") orelse "dev";

const exe_options = b.addOptions();
exe.addOptions("build_options", exe_options);
exe_options.addOption(string, "version", b.option(string, "tag", "") orelse "dev");
exe_options.addOption(string, "version", tag);

deps.addAllTo(exe);
b.installArtifact(exe);
Expand Down

0 comments on commit 5403d1a

Please sign in to comment.