Skip to content

Commit c4f8e54

Browse files
committed
fix: windows support
1 parent f3e3cd8 commit c4f8e54

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

build.zig

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,23 @@ pub fn build(b: *std.Build) void {
66

77
const bchunk = b.dependency("bchunk", .{});
88

9-
const bchunk_mod = b.createModule(.{
9+
const mod = b.createModule(.{
1010
.target = target,
1111
.optimize = optimize,
1212
.link_libc = true,
1313
});
1414

15-
bchunk_mod.addCSourceFile(.{
15+
mod.addCSourceFile(.{
1616
.file = bchunk.builder.path("bchunk.c"),
1717
});
1818

19+
if (target.result.os.tag == .windows) {
20+
mod.linkSystemLibrary("ws2_32", .{});
21+
}
22+
1923
const exe = b.addExecutable(.{
2024
.name = "bchunk",
21-
.root_module = bchunk_mod,
25+
.root_module = mod,
2226
});
2327

2428
b.installArtifact(exe);

build.zig.zon

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
.minimum_zig_version = "0.15.1",
66
.dependencies = .{
77
.bchunk = .{
8-
.url = "https://github.com/hessu/bchunk/archive/refs/tags/release/1.2.2.tar.gz",
9-
.hash = "N-V-__8AAEioAACEKJ1Kyxhwk-TXBfaRBszr74whx5omexvh",
8+
.url = "https://github.com/hessu/bchunk/archive/2d57a4b2477f1f4098d640a089e97fae4cf5abcf.tar.gz",
9+
.hash = "N-V-__8AALOpAABW3IKYd7xgnDgg2RDHwYfiZfPKU4XQxyce",
1010
},
1111
},
1212
.paths = .{

0 commit comments

Comments
 (0)