build(zig): use build root instead of cwd (#3944)

`std.fs.cwd` refers to the cwd of the build process, which is not the
root of tree-sitter when tree-sitter is used as a sub-module.

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
This commit is contained in:
aleloi 2024-11-15 11:47:01 +01:00 committed by GitHub
parent bcf82da55c
commit 00d34e86a3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -99,7 +99,7 @@ fn wasmtimeDep(target: std.Target) []const u8 {
fn findSourceFiles(b: *std.Build) ![]const []const u8 {
var sources = std.ArrayList([]const u8).init(b.allocator);
var dir = try std.fs.cwd().openDir("lib/src", .{ .iterate = true });
var dir = try b.build_root.handle.openDir("lib/src", .{ .iterate = true });
var iter = dir.iterate();
defer dir.close();