summaryrefslogtreecommitdiff
path: root/build/core.zig
diff options
context:
space:
mode:
Diffstat (limited to 'build/core.zig')
-rw-r--r--build/core.zig9
1 files changed, 6 insertions, 3 deletions
diff --git a/build/core.zig b/build/core.zig
index f9cb450f..c787fdc8 100644
--- a/build/core.zig
+++ b/build/core.zig
@@ -131,9 +131,11 @@ fn patchesHash(b: *std.Build, io: std.Io) u64 {
return h;
}
-fn vendoredThemes(b: *std.Build, io: std.Io) []const []const u8 {
+/// The theme sources in `sub` of vendor/themes, sorted: the ring's (`.`),
+/// or the retired ones kept themes inherit from (`base`, read, never rung).
+fn vendoredThemes(b: *std.Build, io: std.Io, sub: []const u8) []const []const u8 {
var names: std.ArrayList([]const u8) = .empty;
- var dir = b.root.root_dir.handle.openDir(io, "vendor/themes", .{ .iterate = true }) catch @panic("open vendor/themes");
+ var dir = b.root.root_dir.handle.openDir(io, b.pathJoin(&.{ "vendor/themes", sub }), .{ .iterate = true }) catch @panic("open vendor/themes");
defer dir.close(io);
var it = dir.iterate();
while (it.next(io) catch @panic("read vendor/themes")) |e| {
@@ -161,7 +163,8 @@ pub fn generatedThemes(b: *std.Build, io: std.Io, target: std.Build.ResolvedTarg
});
const run_theme_gen = b.addRunArtifact(theme_gen);
const themes_out = run_theme_gen.addOutputDirectoryArg("themes");
- for (vendoredThemes(b, io)) |name| run_theme_gen.addFileArg(b.path(b.fmt("vendor/themes/{s}", .{name})));
+ for (vendoredThemes(b, io, ".")) |name| run_theme_gen.addFileArg(b.path(b.fmt("vendor/themes/{s}", .{name})));
+ for (vendoredThemes(b, io, "base")) |name| run_theme_gen.addPrefixedFileArg("base=", b.path(b.fmt("vendor/themes/base/{s}", .{name})));
return b.createModule(.{
.target = target,
.optimize = optimize,