Skip to content

Commit 973d23d

Browse files
james-elicxjinzhongjia
authored andcommitted
open dir relative to build root when building examples
1 parent 24ad0be commit 973d23d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

build.zig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ fn buildExamples(b: *Build, options: BuildExamplesOptions) !void {
182182
const build_all_step = b.step("examples", "build all examples");
183183
const examples_path = lazy_path.getPath(b);
184184

185-
var examples_dir = std.fs.openDirAbsolute(examples_path, .{ .iterate = true }) catch |err| {
185+
var examples_dir = b.build_root.handle.openDir(examples_path, .{ .iterate = true }) catch |err| {
186186
switch (err) {
187187
error.FileNotFound => return,
188188
else => return err,
@@ -233,4 +233,3 @@ fn buildExample(
233233
const exe_run_step = b.step(step_name, step_desc);
234234
exe_run_step.dependOn(&exe_run.step);
235235
}
236-

0 commit comments

Comments
 (0)