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.pull/8983/head
parent
f41e61cd31
commit
09e4c1e6f2
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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 };
|
||||
Loading…
Reference in New Issue