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