From 2b73fbaa0de99e472bfda4dafe412a6a69276bfd Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 27 Feb 2023 21:53:09 -0800 Subject: [PATCH] iterating on the new for loop syntax --- build.zig | 13 ++++++++++--- pkg/harfbuzz/build.zig | 11 ++++++----- vendor/libxev | 2 +- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/build.zig b/build.zig index 9ddc81aa4..3e08f230c 100644 --- a/build.zig +++ b/build.zig @@ -454,9 +454,16 @@ fn addDeps( system_sdk.include(b, step, .{}); // We always need the Zig packages + // TODO: This can't be the right way to use the new Zig modules system, + // so take a closer look at this again later. if (enable_fontconfig) step.addModule("fontconfig", fontconfig.module(b)); - step.addModule("freetype", freetype.module(b)); - step.addModule("harfbuzz", harfbuzz.module(b)); + const mod_freetype = freetype.module(b); + const mod_macos = macos.module(b); + step.addModule("freetype", mod_freetype); + step.addModule("harfbuzz", harfbuzz.module(b, .{ + .freetype = mod_freetype, + .macos = mod_macos, + })); step.addModule("imgui", imgui.module(b)); step.addModule("xev", libxev.module(b)); step.addModule("pixman", pixman.module(b)); @@ -466,7 +473,7 @@ fn addDeps( // Mac Stuff if (step.target.isDarwin()) { step.addModule("objc", objc.module(b)); - step.addModule("macos", macos.module(b)); + step.addModule("macos", mod_macos); _ = try macos.link(b, step, .{}); } diff --git a/pkg/harfbuzz/build.zig b/pkg/harfbuzz/build.zig index 9c0d26129..c1370ef86 100644 --- a/pkg/harfbuzz/build.zig +++ b/pkg/harfbuzz/build.zig @@ -1,6 +1,4 @@ const std = @import("std"); -const freetypepkg = @import("../freetype/build.zig"); -const macospkg = @import("../macos/build.zig"); /// Directories with our includes. const root = thisDir() ++ "../../../vendor/harfbuzz/"; @@ -8,12 +6,15 @@ const include_path = root ++ "src/"; pub const include_paths = .{include_path}; -pub fn module(b: *std.Build) *std.build.Module { +pub fn module(b: *std.Build, deps: struct { + freetype: *std.build.Module, + macos: *std.build.Module, +}) *std.build.Module { return b.createModule(.{ .source_file = .{ .path = (comptime thisDir()) ++ "/main.zig" }, .dependencies = &.{ - .{ .name = "freetype", .module = freetypepkg.module(b) }, - .{ .name = "macos", .module = macospkg.module(b) }, + .{ .name = "freetype", .module = deps.freetype }, + .{ .name = "macos", .module = deps.macos }, }, }); } diff --git a/vendor/libxev b/vendor/libxev index 62f25af92..59132b17b 160000 --- a/vendor/libxev +++ b/vendor/libxev @@ -1 +1 @@ -Subproject commit 62f25af92c666a0b0771b9d35719b88a342a2ced +Subproject commit 59132b17bc800eab7d3e995fcda42e835dba5df6