diff options
| author | Mitchell Hashimoto <m@mitchellh.com> | 2025-10-01 07:00:41 -0700 |
|---|---|---|
| committer | Mitchell Hashimoto <m@mitchellh.com> | 2025-10-01 07:04:54 -0700 |
| commit | 09e4c1e6f2f86de1b92fd1dd4d057f293f58fa34 (patch) | |
| tree | 958f1d442ca3c30fd01f59715ca70c7bab9adb84 /src/build | |
| parent | f41e61cd31a1e5555a9a52ae29da6ee37f150d1f (diff) | |
build: isolate XCFramework.Target so runtime code doesn't depend on it
This fixes the lazyImport importing outside of the build root. The build
root for the build binary is always the root `build.zig` (which we
want), but our `src/build_config.zig` transitively imported SharedDeps
which led to issues.
Diffstat (limited to 'src/build')
| -rw-r--r-- | src/build/Config.zig | 6 | ||||
| -rw-r--r-- | src/build/GhosttyXCFramework.zig | 3 | ||||
| -rw-r--r-- | src/build/xcframework.zig | 3 |
3 files changed, 7 insertions, 5 deletions
diff --git a/src/build/Config.zig b/src/build/Config.zig index 0b7dae14d..e0e81e519 100644 --- a/src/build/Config.zig +++ b/src/build/Config.zig @@ -9,7 +9,7 @@ const ApprtRuntime = @import("../apprt/runtime.zig").Runtime; const FontBackend = @import("../font/backend.zig").Backend; const RendererBackend = @import("../renderer/backend.zig").Backend; const TerminalBuildOptions = @import("../terminal/build_options.zig").Options; -const XCFramework = @import("GhosttyXCFramework.zig"); +const XCFrameworkTarget = @import("xcframework.zig").Target; const WasmTarget = @import("../os/wasm/target.zig").Target; const expandPath = @import("../os/path.zig").expand; @@ -26,7 +26,7 @@ const app_version: std.SemanticVersion = .{ .major = 1, .minor = 2, .patch = 1 } /// Standard build configuration options. optimize: std.builtin.OptimizeMode, target: std.Build.ResolvedTarget, -xcframework_target: XCFramework.Target = .universal, +xcframework_target: XCFrameworkTarget = .universal, wasm_target: WasmTarget, /// Comptime interfaces @@ -121,7 +121,7 @@ pub fn init(b: *std.Build) !Config { //--------------------------------------------------------------- // Target-specific properties config.xcframework_target = b.option( - XCFramework.Target, + XCFrameworkTarget, "xcframework-target", "The target for the xcframework.", ) orelse .universal; diff --git a/src/build/GhosttyXCFramework.zig b/src/build/GhosttyXCFramework.zig index d036e7020..3afeb9073 100644 --- a/src/build/GhosttyXCFramework.zig +++ b/src/build/GhosttyXCFramework.zig @@ -5,12 +5,11 @@ const Config = @import("Config.zig"); const SharedDeps = @import("SharedDeps.zig"); const GhosttyLib = @import("GhosttyLib.zig"); const XCFrameworkStep = @import("XCFrameworkStep.zig"); +const Target = @import("xcframework.zig").Target; xcframework: *XCFrameworkStep, target: Target, -pub const Target = enum { native, universal }; - pub fn init( b: *std.Build, deps: *const SharedDeps, diff --git a/src/build/xcframework.zig b/src/build/xcframework.zig new file mode 100644 index 000000000..8713a1c9a --- /dev/null +++ b/src/build/xcframework.zig @@ -0,0 +1,3 @@ +/// Target for xcframework builds. This is a separate file so that +/// our runtime code doesn't need to import build code. +pub const Target = enum { native, universal }; |
