Skip to content

Commit

Permalink
Merge pull request #59 from chenrui333/override-version
Browse files Browse the repository at this point in the history
feat: add `force-version` option to set version for source tarball build
  • Loading branch information
Arnau478 authored Jan 19, 2025
2 parents 9df676e + 810fdf7 commit 10c0236
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ const release_targets: []const std.Target.Query = &.{
};

fn getVersion(b: *std.Build) SemanticVersion {
if (b.option([]const u8, "force-version", "Force the version to a specific semver string")) |forced_ver| {
return SemanticVersion.parse(forced_ver) catch @panic("Unable to parse forced version string");
}

var ast = Ast.parse(b.allocator, @embedFile("build.zig.zon"), .zon) catch @panic("OOM");
defer ast.deinit(b.allocator);

Expand Down Expand Up @@ -139,7 +143,6 @@ pub fn build(b: *std.Build) !void {
}

const run_cmd = b.addRunArtifact(exe);

run_cmd.step.dependOn(b.getInstallStep());

if (b.args) |args| {
Expand Down

0 comments on commit 10c0236

Please sign in to comment.