diff options
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -823,7 +823,11 @@ pub fn build(b: *std.Build) void { // One call per module instead of one line per module per dependency, and // BEFORE the fold below, which reads what these imports put in the table. + // The kinds' C ABI (src/kinds/pardes_addon.h), translated once: the core's + // records are the header's, never a mirror of it. + const kind_mod = b.addTranslateC(.{ .root_source_file = b.path("src/kinds/pardes_addon.h"), .target = target, .optimize = optimize }).createModule(); for (core_mods) |m| wireCore(m, .{ + .kind = kind_mod, .themes = themes_mod, .tree_sitter = ts_mod, .ts_libs = ts_libs.items, @@ -1899,6 +1903,7 @@ fn vendoredThemes(b: *std.Build, io: std.Io) []const []const u8 { } fn wireCore(m: *std.Build.Module, d: struct { + kind: ?*std.Build.Module = null, themes: ?*std.Build.Module = null, tree_sitter: ?*std.Build.Module = null, ts_libs: []const *std.Build.Step.Compile = &.{}, @@ -1913,6 +1918,7 @@ fn wireCore(m: *std.Build.Module, d: struct { wuffs: ?*std.Build.Module = null, xitdb: ?*std.Build.Module = null, }) void { + if (d.kind) |x| m.addImport("pardes_addon", x); if (d.themes) |x| m.addImport("generated_themes", x); if (d.tree_sitter) |x| m.addImport("tree-sitter", x); for (d.ts_libs) |lib| m.linkLibrary(lib); |
