Skip to content

Commit 89839c3

Browse files
committed
build: pass zig lib dir as directory instead of as string
1 parent 6a7ca4b commit 89839c3

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

build.zig

+8-1
Original file line numberDiff line numberDiff line change
@@ -1392,7 +1392,14 @@ fn generateLangRef(b: *std.Build) std.Build.LazyPath {
13921392
// in a temporary directory
13931393
"--cache-root", b.cache_root.path orelse ".",
13941394
});
1395-
cmd.addArgs(&.{ "--zig-lib-dir", b.fmt("{}", .{b.graph.zig_lib_directory}) });
1395+
if (b.graph.zig_lib_directory.path) |zig_lib_dir| {
1396+
cmd.addArgs(&.{"--zig-lib-dir"});
1397+
if (fs.path.isAbsolute(zig_lib_dir)) {
1398+
cmd.addArgs(&.{zig_lib_dir});
1399+
} else {
1400+
cmd.addDirectoryArg(b.path(zig_lib_dir));
1401+
}
1402+
}
13961403
cmd.addArgs(&.{"-i"});
13971404
cmd.addFileArg(b.path(b.fmt("doc/langref/{s}", .{entry.name})));
13981405

0 commit comments

Comments
 (0)