Update for zig-current

This commit is contained in:
Frank Denis
2026-05-27 14:01:56 +02:00
parent cb20f6d9cd
commit 63b30034a6
+5 -3
View File
@@ -170,12 +170,14 @@ fn initLibConfig(b: *std.Build, target: std.Build.ResolvedTarget, lib: *Compile)
pub fn build(b: *std.Build) !void {
const io: Io = if (is_zig_16) b.graph.io else {};
const root_path = b.pathFromRoot(".");
const cwd = try if (is_zig_16) Dir.cwd().openDir(io, root_path, .{}) else std.fs.cwd().openDir(root_path, .{});
const cwd = if (is_zig_16)
try b.root.openDir(io, ".", .{})
else
try std.fs.cwd().openDir(b.build_root.path orelse ".", .{});
const src_path = "src/libsodium";
const src_dir = if (is_zig_16)
try cwd.openDir(io, src_path, .{ .iterate = true })
try b.root.openDir(io, src_path, .{ .iterate = true })
else if (@hasField(Dir.OpenOptions, "follow_symlinks"))
try cwd.openDir(src_path, .{ .iterate = true, .follow_symlinks = false })
else