diff --git a/src/build/Config.zig b/src/build/Config.zig index a842e428e..59e3c5a3c 100644 --- a/src/build/Config.zig +++ b/src/build/Config.zig @@ -60,6 +60,7 @@ emit_macos_app: bool = false, emit_terminfo: bool = false, emit_termcap: bool = false, emit_test_exe: bool = false, +emit_themes: bool = false, emit_xcframework: bool = false, emit_webdata: bool = false, emit_unicode_table_gen: bool = false, @@ -366,6 +367,12 @@ pub fn init(b: *std.Build) !Config { .ReleaseSafe, .ReleaseFast, .ReleaseSmall => false, }; + config.emit_themes = b.option( + bool, + "emit-themes", + "Install bundled iTerm2-Color-Schemes Ghostty themes", + ) orelse true; + config.emit_webdata = b.option( bool, "emit-webdata", diff --git a/src/build/GhosttyResources.zig b/src/build/GhosttyResources.zig index 266069f83..a7b9a9032 100644 --- a/src/build/GhosttyResources.zig +++ b/src/build/GhosttyResources.zig @@ -118,14 +118,16 @@ pub fn init(b: *std.Build, cfg: *const Config) !GhosttyResources { } // Themes - if (b.lazyDependency("iterm2_themes", .{})) |upstream| { - const install_step = b.addInstallDirectory(.{ - .source_dir = upstream.path(""), - .install_dir = .{ .custom = "share" }, - .install_subdir = b.pathJoin(&.{ "ghostty", "themes" }), - .exclude_extensions = &.{".md"}, - }); - try steps.append(&install_step.step); + if (cfg.emit_themes) { + if (b.lazyDependency("iterm2_themes", .{})) |upstream| { + const install_step = b.addInstallDirectory(.{ + .source_dir = upstream.path(""), + .install_dir = .{ .custom = "share" }, + .install_subdir = b.pathJoin(&.{ "ghostty", "themes" }), + .exclude_extensions = &.{".md"}, + }); + try steps.append(&install_step.step); + } } // Fish shell completions