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 {...@@ -17,14 +17,14 @@ pub fn build(b: *std.Build) void {
17 .target = target,17 .target = target,
18 .optimize = mode,18 .optimize = mode,
19 });19 });
20 const tag = b.option(string, "tag", "") orelse "dev";20 const tag = b.option(string, "tag", "");
21 const strip = b.option(bool, "strip", "Build without debug info.") orelse false;21 const strip = b.option(bool, "strip", "Build without debug info.") orelse false;
22 const disable_llvm = b.option(bool, "disable_llvm", "use the non-llvm zig codegen") orelse false;22 const disable_llvm = b.option(bool, "disable_llvm", "use the non-llvm zig codegen") orelse false;
23 _ = &disable_llvm; // macos can't mix the flags rn because it needs llvm but also can't use lld23 _ = &disable_llvm; // macos can't mix the flags rn because it needs llvm but also can't use lld
2424
25 const exe_options = b.addOptions();25 const exe_options = b.addOptions();
26 exe.root_module.addImport("build_options", exe_options.createModule());26 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
29 deps.addAllTo(exe);29 deps.addAllTo(exe);
30 exe.root_module.strip = strip;30 exe.root_module.strip = strip;