Skip to content

Commit 13a40b8

Browse files
committed
adjust build.zig
1 parent 344828d commit 13a40b8

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

build.zig

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ pub fn build(b: *std.Build) void {
55
const dependencies = [_][]const u8{
66
"clap",
77
"regex",
8-
"curl",
98
};
109

1110
const target = b.standardTargetOptions(.{});
@@ -23,10 +22,14 @@ pub fn build(b: *std.Build) void {
2322
});
2423

2524
for (dependencies) |dependency| {
26-
const dep = b.dependency(dependency, .{});
25+
const dep = b.dependency(dependency, .{ .target = target, .optimize = optimize });
2726
exe.root_module.addImport(dependency, dep.module(dependency));
2827
}
2928

29+
// Deps that break the easy import flow
30+
const d = b.dependency("curl", .{ .target = target, .optimize = optimize });
31+
exe.root_module.addImport("curl", d.module("curl"));
32+
3033
exe.linkLibC();
3134

3235
b.installArtifact(exe);

build.zig.zon

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545
.hash = "regex-0.1.2-axC350bnAQCyrPkH2IEfri8hebJO6IujGY1rhcgZBXpL",
4646
},
4747
.curl = .{
48-
.url = "https://github.com/jiacai2050/zig-curl/archive/refs/tags/v0.3.1.zip",
49-
.hash = "curl-0.3.1-P4tT4b_JAAC2bpWR1_NjsHTrg_Ufz2mmojU-e-y9k_99",
48+
.url = "git+https://github.com/jiacai2050/zig-curl/?ref=HEAD#df369a2925a57446cb3147def4e11e6782452dbd",
49+
.hash = "curl-0.3.1-P4tT4X_LAAB-rzh6tsg_j9OSokOCTt6pK4DxFUYUwC7K",
5050
},
5151
},
5252
.paths = .{

0 commit comments

Comments
 (0)