mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-09-20 12:38:08 +00:00
build: default dependencies to lib-vt mode
Related to #10651 Default Ghostty dependency builds to libghostty-vt-only mode and avoid initializing anything that would trigger broader dependency requirements. The impact of this is that Zig consumers can import ghostty-vt without requiring Xcode on macOS.
This commit is contained in:
@@ -73,11 +73,15 @@ pub fn init(b: *std.Build, appVersion: []const u8, libVersion: []const u8) !Conf
|
||||
// Setup our standard Zig target and optimize options, i.e.
|
||||
// `-Doptimize` and `-Dtarget`.
|
||||
const optimize = b.standardOptimizeOption(.{});
|
||||
|
||||
// Default dependency builds to libghostty-vt-only mode. Consumers can
|
||||
// still explicitly disable this to request the full Ghostty build.
|
||||
const is_dep = b.dep_prefix.len > 0;
|
||||
const emit_lib_vt = b.option(
|
||||
bool,
|
||||
"emit-lib-vt",
|
||||
"Set defaults for a libghostty-vt-only build (disables xcframework, macOS app, and docs).",
|
||||
) orelse false;
|
||||
) orelse is_dep;
|
||||
const target = target: {
|
||||
var result = b.standardTargetOptions(.{});
|
||||
|
||||
@@ -114,10 +118,6 @@ pub fn init(b: *std.Build, appVersion: []const u8, libVersion: []const u8) !Conf
|
||||
break :target result;
|
||||
};
|
||||
|
||||
// Detect if Ghostty is a dependency of another project.
|
||||
// dep_prefix is non-empty when this build is running as a dependency.
|
||||
const is_dep = b.dep_prefix.len > 0;
|
||||
|
||||
// This is set to true when we're building a system package. For now
|
||||
// this is trivially detected using the "system_package_mode" bool
|
||||
// but we may want to make this more sophisticated in the future.
|
||||
|
||||
Reference in New Issue
Block a user