Skip to content

Commit 3dcb648

Browse files
committed
zig build: API minor changes
1 parent bedeab3 commit 3dcb648

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

build.zig

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

77
// Module
88
_ = b.addModule("Qt", .{
9-
.source_file = .{
9+
.root_source_file = .{
1010
.path = "src/Qt.zig",
1111
},
1212
});
@@ -75,16 +75,15 @@ fn makeExample(b: *std.Build, src: BuildInfo) !void {
7575

7676
//Strip file
7777
if (src.optimize != .Debug) {
78-
example.strip = true;
78+
example.root_module.strip = true;
7979
}
8080

81-
example.addModule("Qt", b.modules.get("Qt").?);
81+
example.root_module.addImport("Qt", b.modules.get("Qt").?);
8282
example.addLibraryPath(.{ .path = "zig-cache/lib" });
8383

84-
if (example.target.isWindows()) {
84+
if (example.rootModuleTarget().os.tag == .windows)
8585
example.want_lto = false;
86-
example.linkSystemLibraryName("DOtherSide.dll");
87-
} else example.linkSystemLibrary("DOtherSide");
86+
example.linkSystemLibrary("DOtherSide");
8887
example.linkLibC();
8988

9089
b.installArtifact(example);
@@ -102,7 +101,8 @@ fn makeExample(b: *std.Build, src: BuildInfo) !void {
102101

103102
pub fn cmakeBuild(b: *std.Build) *std.Build.Step.Run {
104103
const dotherside = b.dependency("dotherside", .{}).path("").getPath(b);
105-
//CMake builds - DOtherSide build
104+
105+
// CMake builds - DOtherSide build
106106
const DOtherSide_configure = b.addSystemCommand(&[_][]const u8{
107107
"cmake",
108108
"-B",
@@ -124,7 +124,7 @@ pub fn cmakeBuild(b: *std.Build) *std.Build.Step.Run {
124124

125125
const BuildInfo = struct {
126126
path: []const u8,
127-
target: std.zig.CrossTarget,
127+
target: std.Build.ResolvedTarget,
128128
optimize: std.builtin.OptimizeMode,
129129

130130
fn filename(self: BuildInfo) []const u8 {

0 commit comments

Comments
 (0)