diff --git a/build.zig b/build.zig index 6a6cade..e24d419 100644 --- a/build.zig +++ b/build.zig @@ -53,10 +53,28 @@ pub fn build(b: *std.Build) !void { // deps ======================================================================= + const libc = libc: { + break :libc std.zig.LibCDirs.detect( + b.graph.arena, + b.graph.io, + b.graph.zig_lib_directory.path orelse break :libc error.NoZigLib, + &target.result, + target.query.isNativeAbi(), + true, + null, + &b.graph.environ_map, + ); + } catch |err| std.debug.panic("failed to locate libc: {s}", .{@errorName(err)}); + + var include_paths: std.ArrayList(std.Build.LazyPath) = try .initCapacity(b.allocator, libc.libc_include_dir_list.len); + for (libc.libc_include_dir_list) |include_dir| + try include_paths.append(b.allocator, .{ .cwd_relative = include_dir }); + const zlua = b.dependency("zlua", .{ .target = target, .optimize = optimize, .lang = .luau, + .additional_system_headers = try include_paths.toOwnedSlice(b.allocator), }); mod.addImport("zlua", zlua.module("zlua")); diff --git a/build.zig.zon b/build.zig.zon index 8d990df..c064947 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -36,8 +36,8 @@ .hash = "fern-0.0.0-iF4X_f4_AACf2ObLkd2j22ZK1iNxNJUVo2YCJI9i4M0z", }, .zlua = .{ - .url = "git+https://github.com/natecraddock/ziglua?ref=main#b23143c54b2fc5207825336fb7e61220756dc0a6", - .hash = "zlua-0.1.0-hGRpC4t-BQDQJLgY32R_bGhGNHNNULWAh5ltxho4_pQw", + .url = "/home/robin/dev/ziglua", + .hash = "zlua-0.1.0-hGRpC7iUBQCAr7Ly0oLKftVpmRQzudXgqHcyeIRXOsCX", }, }, .paths = .{