Skip to content

Commit

Permalink
Make a binary be able to have a simpler name
Browse files Browse the repository at this point in the history
Useful for nix builds

Signed-off-by: emneo <emneo@kreog.com>
  • Loading branch information
emneo-dev committed Sep 9, 2024
1 parent 9044196 commit 3b952a8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ fn create_binary_name(opt: build_options, target: std.Build.ResolvedTarget, allo
);
}

fn configure_binary(b: *std.Build, opt: build_options, target: std.Build.ResolvedTarget, optimize: std.builtin.OptimizeMode, allocator: std.mem.Allocator) !*std.Build.Step.Compile {
const final_bin_name = try create_binary_name(
fn configure_binary(b: *std.Build, opt: build_options, target: std.Build.ResolvedTarget, optimize: std.builtin.OptimizeMode, allocator: std.mem.Allocator, simple_bin_name: bool) !*std.Build.Step.Compile {
const final_bin_name = if (simple_bin_name) opt.bin_name else try create_binary_name(
opt,
target,
allocator,
Expand Down Expand Up @@ -126,6 +126,7 @@ pub fn build(b: *std.Build) !void {
std.Build.resolveTargetQuery(b, target),
optimize,
allocator,
false,
);
} else {
const liskvork = try configure_binary(
Expand All @@ -134,6 +135,7 @@ pub fn build(b: *std.Build) !void {
native_target,
optimize,
allocator,
true,
);

const run_liskvork = b.addRunArtifact(liskvork);
Expand Down

0 comments on commit 3b952a8

Please sign in to comment.