tree-sitter/build.zig
bfredl 32cfceec62 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
2024-04-26 14:17:31 +02:00

18 lines
549 B
Zig

const std = @import("std");
pub fn build(b: *std.Build) void {
var lib = b.addStaticLibrary(.{
.name = "tree-sitter",
.target = b.standardTargetOptions(.{}),
.optimize = b.standardOptimizeOption(.{}),
});
lib.linkLibC();
lib.addCSourceFile(.{ .file = .{ .path = "lib/src/lib.c" }, .flags = &.{"-std=c11"} });
lib.addIncludePath(.{ .path = "lib/include" });
lib.addIncludePath(.{ .path = "lib/src" });
lib.installHeadersDirectory(b.path("lib/include"), ".", .{});
b.installArtifact(lib);
}