Skip to content

Commit 4b7a579

Browse files
committed
build: 0.11: change addExecutable signature
see ziglang/zig@71ff60f1265da83e619b1b6b2488ecb448fdfd36jk
1 parent 6a3c09a commit 4b7a579

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

build.zig

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -719,16 +719,18 @@ fn createBuildExeStep(b: *Builder, path: []const u8, target: std.zig.CrossTarget
719719
const i = std.mem.indexOf(u8, basename, ".zig") orelse basename.len;
720720
const name = basename[0..i];
721721

722-
const step = b.addExecutable(name, path);
723-
step.setBuildMode(mode);
724-
step.setTarget(target);
725-
726-
step.linkLibC();
727-
step.addIncludePath("src");
728-
729722
const output_dir_rel = std.fmt.allocPrint(b.allocator, "zig-out/{s}", .{name}) catch unreachable;
730723
const output_dir = b.pathFromRoot(output_dir_rel);
731-
step.setOutputDir(output_dir);
724+
725+
const step = b.addExecutable(.{
726+
.name = name,
727+
.root_source_file = .{ .path = path },
728+
.optimize = mode,
729+
.target = target,
730+
.link_libc = true,
731+
.output_dir = output_dir,
732+
});
733+
step.addIncludePath(.{ .path = "src" });
732734

733735
if (mode == .ReleaseSafe) {
734736
step.strip = true;

0 commit comments

Comments
 (0)