summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
Diffstat (limited to 'build')
-rw-r--r--build/core.zig17
-rw-r--r--build/tools.zig7
2 files changed, 8 insertions, 16 deletions
diff --git a/build/core.zig b/build/core.zig
index 974d5c7e..b35c066b 100644
--- a/build/core.zig
+++ b/build/core.zig
@@ -60,11 +60,11 @@ pub fn command(b: *std.Build, argv: []const []const u8) ?[]const u8 {
pub const ShellConfig = struct {
tree_sitter_grammars: TreeSitterGrammars,
- tracy: bool = false,
+ /// -Dtracy's checkout, whose client a core that asks compiles in.
+ tracy: ?[]const u8 = null,
/// null = "the platform's own default": the macOS shell hands the row to
/// its native menu bar, every other shell keeps the acme topbar.
workspace_tag: ?bool = null,
- prebuilt_shaders: bool = false,
embed_sources: bool = false,
commit: ?[]const u8 = null,
/// The jj change git HEAD is in, and when this configure ran: the
@@ -79,11 +79,8 @@ pub const ShellConfig = struct {
pub fn shellOptions(b: *std.Build, cfg: ShellConfig, platform: Platform) *std.Build.Step.Options {
const o = b.addOptions();
o.addOption(Platform, "platform", platform);
- o.addOption(bool, "syntax_highlighting", cfg.tree_sitter_grammars != .disabled);
- o.addOption(bool, "syntax_zig_grammar", cfg.tree_sitter_grammars != .disabled);
- o.addOption(bool, "syntax_minimal_grammars", cfg.tree_sitter_grammars == .minimal or cfg.tree_sitter_grammars == .full);
- o.addOption(bool, "syntax_full_grammars", cfg.tree_sitter_grammars == .full);
- o.addOption(bool, "enable_tracy", cfg.tracy);
+ o.addOption(TreeSitterGrammars, "grammars", cfg.tree_sitter_grammars);
+ o.addOption(bool, "enable_tracy", cfg.tracy != null);
o.addOption(bool, "workspace_tag", cfg.workspace_tag orelse (platform != .macos));
o.addOption(bool, "embed_sources", cfg.embed_sources);
o.addOption([]const u8, "version", display_version);
@@ -429,8 +426,6 @@ pub fn assemble(b: *std.Build, c: struct {
target: std.Build.ResolvedTarget,
optimize: std.lang.Optimize,
c_optimize: std.lang.Optimize,
- tree_sitter_grammars: TreeSitterGrammars,
- tracy: ?[]const u8,
shell_cfg: ShellConfig,
platform: Platform,
also_gui: bool,
@@ -455,7 +450,7 @@ pub fn assemble(b: *std.Build, c: struct {
// nothing else. pardes takes these whatever it builds: the missing ones
// are asked for here in one round, the grammars with them, where each
// `b.dependency` below would end the configure to fetch its own alone.
- const ts = treeSitter(b, io, target, c_optimize, c.tree_sitter_grammars);
+ const ts = treeSitter(b, io, target, c_optimize, c.shell_cfg.tree_sitter_grammars);
inline for (.{ "cloud9", "vaxis", "ghostty", "uucode", "zstbi", "mvzr", "zstd", "xitdb" }) |name| {
// A dependency by path (none of these today) has no hash and is always there.
const dep = @field(zon.dependencies, name);
@@ -623,7 +618,7 @@ pub fn assemble(b: *std.Build, c: struct {
.target = target,
.optimize = optimize,
.cloud9 = cloud9,
- .tracy = c.tracy,
+ .tracy = c.shell_cfg.tracy,
.zstd = zstd,
.image = image_addon.root_module,
.pdf = pdf_built.module,
diff --git a/build/tools.zig b/build/tools.zig
index 1343fef9..62e9817a 100644
--- a/build/tools.zig
+++ b/build/tools.zig
@@ -2,7 +2,6 @@ const std = @import("std");
const builtin = @import("builtin");
const Platform = @import("../build.zig").Platform;
const PerfBuild = @import("../build.zig").PerfBuild;
-const TreeSitterGrammars = @import("../build.zig").TreeSitterGrammars;
const core = @import("core.zig");
const testMatch = @import("tests.zig").testMatch;
@@ -42,8 +41,6 @@ pub fn add(b: *std.Build, c: struct {
shell_cfg: core.ShellConfig,
target: std.Build.ResolvedTarget,
test_filters: []const []const u8,
- tracy: ?[]const u8,
- tree_sitter_grammars: TreeSitterGrammars,
unit_profile: *std.Build.Step.Compile,
}) Tools {
const image_harness = program(b, "pardes-image-harness", "test/image_harness.zig", c.target, c.optimize, &.{});
@@ -191,10 +188,10 @@ pub fn add(b: *std.Build, c: struct {
.c_optimize = @tagName(c.c_optimize),
.terminal_optimize = @tagName(c.ghostty_optimize),
.platform = @tagName(c.platform),
- .grammars = @tagName(c.tree_sitter_grammars),
+ .grammars = @tagName(c.shell_cfg.tree_sitter_grammars),
.mupdf = c.pdf_addon != null,
.jpx = c.enable_jpx,
- .tracy = c.tracy != null,
+ .tracy = c.shell_cfg.tracy != null,
.terminal_simd = c.ghostty_simd,
.prebuilt_shaders = c.platform == .gui and c.prebuilt_shaders,
});