Skip to content

Commit 91ee75a

Browse files
committed
build: add -Dxcframework-target to specify the target for builds
1 parent 3793dac commit 91ee75a

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

build.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ pub fn build(b: *std.Build) !void {
9898
const xcframework = try buildpkg.GhosttyXCFramework.init(
9999
b,
100100
&deps,
101-
.universal,
101+
config.xcframework_target,
102102
);
103103
xcframework.install();
104104

src/build/Config.zig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const apprt = @import("../apprt.zig");
99
const font = @import("../font/main.zig");
1010
const rendererpkg = @import("../renderer.zig");
1111
const Command = @import("../Command.zig");
12+
const XCFramework = @import("GhosttyXCFramework.zig");
1213
const WasmTarget = @import("../os/wasm/target.zig").Target;
1314

1415
const gtk = @import("gtk.zig");
@@ -24,6 +25,7 @@ const app_version: std.SemanticVersion = .{ .major = 1, .minor = 1, .patch = 4 }
2425
/// Standard build configuration options.
2526
optimize: std.builtin.OptimizeMode,
2627
target: std.Build.ResolvedTarget,
28+
xcframework_target: XCFramework.Target = .universal,
2729
wasm_target: WasmTarget,
2830

2931
/// Comptime interfaces
@@ -109,6 +111,14 @@ pub fn init(b: *std.Build) !Config {
109111
.env = env,
110112
};
111113

114+
//---------------------------------------------------------------
115+
// Target-specific properties
116+
config.xcframework_target = b.option(
117+
XCFramework.Target,
118+
"xcframework-target",
119+
"The target for the xcframework.",
120+
) orelse .universal;
121+
112122
//---------------------------------------------------------------
113123
// Comptime Interfaces
114124
config.font_backend = b.option(

0 commit comments

Comments
 (0)