Skip to content

Commit 0414ddb

Browse files
committed
make zwindows a lazy dependency
1 parent 7f50059 commit 0414ddb

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

build.zig

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
const std = @import("std");
22

33
pub fn build(b: *std.Build) void {
4-
const zwindows = b.dependency("zwindows", .{
4+
const zopenvr = b.addModule("root", .{
5+
.root_source_file = b.path("src/openvr.zig"),
6+
});
7+
8+
if (b.lazyDependency("zwindows", .{
59
.zxaudio2_debug_layer = b.option(
610
bool,
711
"zxaudio2_debug_layer",
@@ -17,13 +21,9 @@ pub fn build(b: *std.Build) void {
1721
"zd3d12_gbv",
1822
"Enable DirectX 12 GPU-Based Validation (GBV)",
1923
) orelse false,
20-
});
21-
_ = b.addModule("root", .{
22-
.root_source_file = b.path("src/openvr.zig"),
23-
.imports = &.{
24-
.{ .name = "zwindows", .module = zwindows.module("zwindows") },
25-
},
26-
});
24+
})) |zwindows| {
25+
zopenvr.addImport("zwindows", zwindows.module("zwindows"));
26+
}
2727
}
2828

2929
pub fn addLibraryPathsTo(zopenvr: *std.Build.Dependency, compile_step: *std.Build.Step.Compile) void {

build.zig.zon

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
.zwindows = .{
1616
.url = "git+https://github.com/zig-gamedev/zwindows#6c2200ed1f5e02d6b27d803d53e3743a2d1ea0b2",
1717
.hash = "zwindows-0.2.0-dev-xMZ1u6VcDACVsrJqnbgqNJQe3Tk8Lo0zpQ0ngKNwDj0a",
18+
.lazy = true,
1819
},
1920
},
2021
}

0 commit comments

Comments
 (0)