|
1 | 1 | const std = @import("std"); |
2 | 2 |
|
| 3 | +// Build file for Zig 0.15.x |
| 4 | +// For Zig 0.13.x use build.zig |
| 5 | + |
3 | 6 | pub fn build(b: *std.Build) void { |
4 | 7 | const target = b.standardTargetOptions(.{}); |
5 | 8 | const optimize = b.standardOptimizeOption(.{}); |
6 | 9 |
|
7 | | - // Library module |
8 | | - const trinity_mod = b.addModule("trinity", .{ |
| 10 | + // Library module for imports |
| 11 | + const trinity_mod = b.createModule(.{ |
9 | 12 | .root_source_file = b.path("src/trinity.zig"), |
10 | 13 | .target = target, |
11 | 14 | .optimize = optimize, |
12 | 15 | }); |
13 | 16 |
|
14 | 17 | // Library artifact |
15 | | - const lib = b.addStaticLibrary(.{ |
| 18 | + const lib = b.addLibrary(.{ |
16 | 19 | .name = "trinity", |
| 20 | + .linkage = .static, |
17 | 21 | .root_module = b.createModule(.{ |
18 | 22 | .root_source_file = b.path("src/trinity.zig"), |
19 | 23 | .target = target, |
@@ -159,14 +163,14 @@ pub fn build(b: *std.Build) void { |
159 | 163 | // Cross-platform release builds |
160 | 164 | const release_step = b.step("release", "Build release binaries for all platforms"); |
161 | 165 |
|
162 | | - const targets: []const std.Target.Query = &.{ |
| 166 | + const targets_list: []const std.Target.Query = &.{ |
163 | 167 | .{ .cpu_arch = .x86_64, .os_tag = .linux }, |
164 | 168 | .{ .cpu_arch = .x86_64, .os_tag = .macos }, |
165 | 169 | .{ .cpu_arch = .aarch64, .os_tag = .macos }, |
166 | 170 | .{ .cpu_arch = .x86_64, .os_tag = .windows }, |
167 | 171 | }; |
168 | 172 |
|
169 | | - for (targets) |t| { |
| 173 | + for (targets_list) |t| { |
170 | 174 | const release_target = b.resolveTargetQuery(t); |
171 | 175 | const release_exe = b.addExecutable(.{ |
172 | 176 | .name = "firebird", |
|
0 commit comments