Skip to content

Commit 672a041

Browse files
committed
simplify build library
1 parent f37cac4 commit 672a041

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

build.zig

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -169,15 +169,13 @@ const boost_version: std.SemanticVersion = .{ .major = 1, .minor = 87, .patch =
169169
pub fn boostLibraries(b: *std.Build, config: Config) *std.Build.Step.Compile {
170170
const shared = b.option(bool, "shared", "Build as shared library (default: false)") orelse false;
171171

172-
const lib = if (shared) b.addSharedLibrary(.{
172+
const lib = b.addLibrary(.{
173173
.name = "boost",
174-
.target = config.target,
175-
.optimize = config.optimize,
176-
.version = boost_version,
177-
}) else b.addStaticLibrary(.{
178-
.name = "boost",
179-
.target = config.target,
180-
.optimize = config.optimize,
174+
.root_module = b.createModule(.{
175+
.target = config.target,
176+
.optimize = config.optimize,
177+
}),
178+
.linkage = if (shared) .dynamic else .static,
181179
.version = boost_version,
182180
});
183181

0 commit comments

Comments
 (0)