Skip to content

Commit

Permalink
Update build.zig for breaking change ziglang/zig#19597
Browse files Browse the repository at this point in the history
closes #1
  • Loading branch information
MFAshby authored and neurocyte committed May 24, 2024
1 parent 745bf25 commit fa4d66a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ pub fn build(b: *std.Build) void {

lib.linkLibC();
lib.linkLibCpp();
lib.addIncludePath(.{ .path = "tree-sitter/lib/include" });
lib.addIncludePath(.{ .path = "tree-sitter/lib/src" });
lib.addIncludePath(b.path("tree-sitter/lib/include"));
lib.addIncludePath(b.path("tree-sitter/lib/src"));
lib.addCSourceFiles(.{ .files = &.{"tree-sitter/lib/src/lib.c"}, .flags = &flags });

addParser(b, lib, "agda", null);
Expand Down Expand Up @@ -70,10 +70,10 @@ pub fn build(b: *std.Build) void {
addParser(b, lib, "ziggy", "tree-sitter-ziggy");
addParser(b, lib, "ziggy", "tree-sitter-ziggy-schema");
b.installArtifact(lib);
lib.installHeadersDirectory(.{ .path = "tree-sitter/lib/include/tree_sitter" }, "tree_sitter", .{});
lib.installHeadersDirectory(b.path("tree-sitter/lib/include/tree_sitter"), "tree_sitter", .{});

const mod = b.addModule("treez", .{
.root_source_file = .{ .path = "treez/treez.zig" },
.root_source_file = b.path("treez/treez.zig"),
});
mod.linkLibrary(lib);
}
Expand All @@ -91,11 +91,11 @@ fn addParser(b: *std.Build, lib: *std.Build.Step.Compile, comptime lang: []const
lib.addCSourceFiles(.{ .files = &.{scanner_cc}, .flags = &flags });
if (exists(b, scanner))
lib.addCSourceFiles(.{ .files = &.{scanner}, .flags = &flags });
lib.addIncludePath(.{ .path = srcdir });
lib.addIncludePath(b.path(srcdir));

if (exists(b, qrydir)) {
b.installDirectory(.{
.source_dir = .{ .path = qrydir },
.source_dir = b.path(qrydir),
.include_extensions = &[_][]const u8{".scm"},
.install_dir = .{ .custom = "queries" },
.install_subdir = lang,
Expand Down

0 comments on commit fa4d66a

Please sign in to comment.