iterating on the new for loop syntax

This commit is contained in:
Mitchell Hashimoto
2023-02-27 21:53:09 -08:00
parent 8db30107ae
commit 2b73fbaa0d
3 changed files with 17 additions and 9 deletions

View File

@ -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, .{});
}

View File

@ -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 },
},
});
}

2
vendor/libxev vendored

@ -1 +1 @@
Subproject commit 62f25af92c666a0b0771b9d35719b88a342a2ced
Subproject commit 59132b17bc800eab7d3e995fcda42e835dba5df6