Skip to content

Commit 178f1b3

Browse files
committed
build.zig: update to v0.15.1 support
1 parent 398c0b1 commit 178f1b3

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

build.zig

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
const std = @import("std");
2-
3-
const boost_version: std.SemanticVersion = .{
4-
.major = 1,
5-
.minor = 89,
6-
.patch = 0,
7-
};
2+
const zon = @import("build.zig.zon");
83

94
const boost_libs = [_][]const u8{
105
"core",
@@ -131,13 +126,15 @@ const boost_libs = [_][]const u8{
131126
"bloom",
132127
};
133128

134-
pub fn build(b: *std.Build) void {
129+
pub fn build(b: *std.Build) !void {
135130
const target = b.standardTargetOptions(.{});
136131
const optimize = b.standardOptimizeOption(.{});
132+
const version = try std.SemanticVersion.parse(zon.version);
137133

138134
const boost = boostLibraries(b, .{
139135
.target = target,
140136
.optimize = optimize,
137+
.boost_version = version,
141138
.module = .{
142139
.atomic = b.option(bool, "atomic", "Build boost.atomic library (default: false)") orelse false,
143140
.charconv = b.option(bool, "charconv", "Build boost.charconv library (default: false)") orelse false,
@@ -182,7 +179,7 @@ pub fn boostLibraries(b: *std.Build, config: Config) *std.Build.Step.Compile {
182179
.optimize = config.optimize,
183180
}),
184181
.linkage = if (shared) .dynamic else .static,
185-
.version = boost_version,
182+
.version = config.boost_version,
186183
});
187184

188185
inline for (boost_libs) |name| {
@@ -278,6 +275,7 @@ pub const Config = struct {
278275
target: std.Build.ResolvedTarget,
279276
optimize: std.builtin.OptimizeMode,
280277
module: ?boostLibrariesModules = null,
278+
boost_version: ?std.SemanticVersion = null,
281279
};
282280

283281
// No header-only libraries
@@ -1088,7 +1086,7 @@ fn checkSystemLibrary(compile: *std.Build.Step.Compile, name: []const u8) bool {
10881086
}
10891087
}
10901088

1091-
const target = compile.rootModuleTarget();
1089+
const target = &compile.rootModuleTarget();
10921090

10931091
if (std.zig.target.isLibCLibName(target, name)) {
10941092
return is_linking_libc;

build.zig.zon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.{
22
.name = .boost_libraries,
33
.fingerprint = 0x47452d961c0ab97e,
4-
.minimum_zig_version = "0.14.0",
4+
.minimum_zig_version = "0.15.1",
55
.version = "1.89.0",
66
.dependencies = .{
77
.core = .{

0 commit comments

Comments
 (0)