fix(build.zig): remove deprecated addStaticLibrary()

(cherry picked from commit 618b9dd66e)
This commit is contained in:
Ronald T. Casili 2025-07-16 17:08:07 +08:00 committed by Christian Clason
parent d991edf074
commit ad95b2b906

View file

@ -8,17 +8,15 @@ pub fn build(b: *std.Build) !void {
const shared = b.option(bool, "build-shared", "Build a shared library") orelse false;
const amalgamated = b.option(bool, "amalgamated", "Build using an amalgamated source") orelse false;
const lib: *std.Build.Step.Compile = if (!shared) b.addStaticLibrary(.{
const lib: *std.Build.Step.Compile = b.addLibrary(.{
.name = "tree-sitter",
.target = target,
.optimize = optimize,
.link_libc = true,
}) else b.addSharedLibrary(.{
.name = "tree-sitter",
.pic = true,
.target = target,
.optimize = optimize,
.link_libc = true,
.linkage = if (shared) .dynamic else .static,
.root_module = b.createModule(.{
.target = target,
.optimize = optimize,
.link_libc = true,
.pic = if (shared) true else null,
}),
});
if (amalgamated) {