authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-08-11 02:09:12 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-08-11 02:09:12 -07:00
log1d66aac054ac54f39ead1cd87903744bee3b4b33
treecd476bbe917dc9d618d981efeae4520a5f31c682
parent25f39752b3c11fd447eeedbd674db158d5932e72

use 'git describe' for default version instead of hardcoding 'dev'


1 files changed, 2 insertions(+), 2 deletions(-)

build.zig+2-2
......@@ -17,14 +17,14 @@ pub fn build(b: *std.Build) void {
1717 .target = target,
1818 .optimize = mode,
1919 });
20 const tag = b.option(string, "tag", "") orelse "dev";
20 const tag = b.option(string, "tag", "");
2121 const strip = b.option(bool, "strip", "Build without debug info.") orelse false;
2222 const disable_llvm = b.option(bool, "disable_llvm", "use the non-llvm zig codegen") orelse false;
2323 _ = &disable_llvm; // macos can't mix the flags rn because it needs llvm but also can't use lld
2424
2525 const exe_options = b.addOptions();
2626 exe.root_module.addImport("build_options", exe_options.createModule());
27 exe_options.addOption(string, "version", tag);
27 exe_options.addOption(string, "version", tag orelse std.mem.trimRight(u8, b.run(&.{ "git", "describe", "--tags" }), "\n"));
2828
2929 deps.addAllTo(exe);
3030 exe.root_module.strip = strip;