Skip to content

Commit 618b9dd

Browse files
authored
fix(build.zig): remove deprecated addStaticLibrary()
1 parent ccc7071 commit 618b9dd

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

build.zig

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,15 @@ pub fn build(b: *std.Build) !void {
88
const shared = b.option(bool, "build-shared", "Build a shared library") orelse false;
99
const amalgamated = b.option(bool, "amalgamated", "Build using an amalgamated source") orelse false;
1010

11-
const lib: *std.Build.Step.Compile = if (!shared) b.addStaticLibrary(.{
11+
const lib: *std.Build.Step.Compile = b.addLibrary(.{
1212
.name = "tree-sitter",
13-
.target = target,
14-
.optimize = optimize,
15-
.link_libc = true,
16-
}) else b.addSharedLibrary(.{
17-
.name = "tree-sitter",
18-
.pic = true,
19-
.target = target,
20-
.optimize = optimize,
21-
.link_libc = true,
13+
.linkage = if (shared) .dynamic else .static,
14+
.root_module = b.createModule(.{
15+
.target = target,
16+
.optimize = optimize,
17+
.link_libc = true,
18+
.pic = if (shared) true else null,
19+
}),
2220
});
2321

2422
if (amalgamated) {

0 commit comments

Comments
 (0)