Skip to content

Commit 74d6b7c

Browse files
committed
Update to Zig dev+9734e643f
- The `std.fs.Dir` API had recently changed to use `openIterableDir` instead of using the `iterate` config field - Also changed build.zig so that it works on Windows
1 parent 5f5660c commit 74d6b7c

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

.gitattributes

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Auto detect text files and perform LF normalization
2-
* text=auto
2+
* text=auto eol=lf

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
zig-out/
22
zig-cache/
33
.zigmod/
4+
deps.zig

build.zig

+3-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ pub fn build(b: *std.build.Builder) !void {
6868
const target = b.standardTargetOptions(.{});
6969
const mode = b.standardReleaseOptions();
7070

71-
var examplesDir = try std.fs.cwd().openDir("examples", .{ .iterate = true });
71+
var examplesDir = try std.fs.cwd().openIterableDir("examples", .{});
7272
defer examplesDir.close();
7373

7474
const broken = switch (target.getOsTag()) {
@@ -80,7 +80,8 @@ pub fn build(b: *std.build.Builder) !void {
8080
defer walker.deinit();
8181
while (try walker.next()) |entry| {
8282
if (entry.kind == .File and std.mem.eql(u8, std.fs.path.extension(entry.path), ".zig")) {
83-
const name = try std.mem.replaceOwned(u8, b.allocator, entry.path[0 .. entry.path.len - 4], "/", "-");
83+
const name = try std.mem.replaceOwned(u8, b.allocator, entry.path[0 .. entry.path.len - 4],
84+
std.fs.path.sep_str, "-");
8485
defer b.allocator.free(name);
8586

8687
// it is not freed as the path is used later for building

0 commit comments

Comments
 (0)