fix(zig): make usable as a zig dependency

Make this usable as a dependency of a zig 0.12 project:

- build.zig.zon must exist to be used as a zig dependency
- public headers need to be installed as part of the artifact
This commit is contained in:
bfredl 2024-04-24 09:57:16 +02:00 committed by dundargoc
parent 8040baed18
commit 32cfceec62
2 changed files with 12 additions and 0 deletions

View file

@ -12,5 +12,7 @@ pub fn build(b: *std.Build) void {
lib.addIncludePath(.{ .path = "lib/include" });
lib.addIncludePath(.{ .path = "lib/src" });
lib.installHeadersDirectory(b.path("lib/include"), ".", .{});
b.installArtifact(lib);
}

10
build.zig.zon Normal file
View file

@ -0,0 +1,10 @@
.{
.name = "tree-sitter",
.version = "0.22.5",
.paths = .{
"build.zig",
"build.zig.zon",
"lib/src",
"lib/include",
},
}