File tree Expand file tree Collapse file tree 3 files changed +11
-13
lines changed
Expand file tree Collapse file tree 3 files changed +11
-13
lines changed Original file line number Diff line number Diff line change 66
77 .dependencies = .{
88 .core = .{ .path = "src/core" },
9- .clap = .{
10- .path = "src/clap" ,
11- .lazy = true ,
12- },
9+ .clap = .{ .path = "src/clap" , .lazy = true },
1310 },
1411 .paths = .{
1512 "build.zig" ,
Original file line number Diff line number Diff line change @@ -9,24 +9,24 @@ pub fn build(b: *std.Build) !void {
99 .optimize = optimize ,
1010 });
1111
12- const clap_dep = b .dependency ("clap_c" , .{});
13-
14- const clap_c = b .addTranslateC (.{
15- .root_source_file = clap_dep .path ("include/clap/clap.h" ),
16- .target = target ,
17- .optimize = optimize ,
18- });
19-
2012 const module = b .addModule ("clap" , .{
2113 .target = target ,
2214 .optimize = optimize ,
2315 .root_source_file = b .path ("root.zig" ),
2416 .imports = &.{
2517 .{ .name = "zigplug" , .module = root .module ("zigplug" ) },
26- .{ .name = "clap_c" , .module = clap_c .createModule () },
2718 },
2819 });
2920
21+ if (b .lazyDependency ("clap_c" , .{})) | clap_dep | {
22+ const clap_c = b .addTranslateC (.{
23+ .root_source_file = clap_dep .path ("include/clap/clap.h" ),
24+ .target = target ,
25+ .optimize = optimize ,
26+ });
27+ module .addImport ("clap_c" , clap_c .createModule ());
28+ }
29+
3030 module .addImport ("clap" , module );
3131
3232 const test_step = b .step ("test" , "Run unit tests" );
Original file line number Diff line number Diff line change 99 .clap_c = .{
1010 .url = "https://github.com/free-audio/clap/archive/refs/tags/1.2.6.tar.gz" ,
1111 .hash = "N-V-__8AABAqOwDxKlwerqbiBlg183KUY751DdoGwZ9N-ZuE" ,
12+ .lazy = true ,
1213 },
1314 },
1415
You can’t perform that action at this time.
0 commit comments