mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
pkg/macos
This commit is contained in:
@ -739,7 +739,7 @@ fn addDeps(
|
||||
if (step.target.isDarwin()) {
|
||||
step.addModule("objc", objc_dep.module("objc"));
|
||||
step.addModule("macos", macos_dep.module("macos"));
|
||||
//_ = try macos.link(b, step, .{});
|
||||
step.linkLibrary(macos_dep.artifact("macos"));
|
||||
|
||||
// todo: do this is in zig-objc instead.
|
||||
step.linkSystemLibraryName("objc");
|
||||
|
@ -1,52 +1,34 @@
|
||||
const std = @import("std");
|
||||
const builtin = @import("builtin");
|
||||
const apple_sdk = @import("apple_sdk");
|
||||
|
||||
pub fn build(b: *std.Build) !void {
|
||||
const target = b.standardTargetOptions(.{});
|
||||
const optimize = b.standardOptimizeOption(.{});
|
||||
_ = target;
|
||||
_ = optimize;
|
||||
|
||||
_ = b.addModule("macos", .{ .source_file = .{ .path = "main.zig" } });
|
||||
}
|
||||
|
||||
pub fn module(b: *std.Build) *std.build.Module {
|
||||
return b.createModule(.{
|
||||
.source_file = .{ .path = (comptime thisDir()) ++ "/main.zig" },
|
||||
});
|
||||
}
|
||||
|
||||
fn thisDir() []const u8 {
|
||||
return std.fs.path.dirname(@src().file) orelse ".";
|
||||
}
|
||||
|
||||
pub const Options = struct {};
|
||||
|
||||
pub fn link(
|
||||
b: *std.Build,
|
||||
step: *std.build.LibExeObjStep,
|
||||
opt: Options,
|
||||
) !*std.build.LibExeObjStep {
|
||||
_ = opt;
|
||||
var flags = std.ArrayList([]const u8).init(b.allocator);
|
||||
defer flags.deinit();
|
||||
|
||||
const lib = b.addStaticLibrary(.{
|
||||
.name = "macos",
|
||||
.target = step.target,
|
||||
.optimize = step.optimize,
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
});
|
||||
step.addCSourceFile(.{
|
||||
.file = .{ .path = comptime thisDir() ++ "/os/log.c" },
|
||||
|
||||
var flags = std.ArrayList([]const u8).init(b.allocator);
|
||||
defer flags.deinit();
|
||||
lib.addCSourceFile(.{
|
||||
.file = .{ .path = "os/log.c" },
|
||||
.flags = flags.items,
|
||||
});
|
||||
step.addCSourceFile(.{
|
||||
.file = .{ .path = comptime thisDir() ++ "/text/ext.c" },
|
||||
lib.addCSourceFile(.{
|
||||
.file = .{ .path = "text/ext.c" },
|
||||
.flags = flags.items,
|
||||
});
|
||||
step.linkFramework("Carbon");
|
||||
step.linkFramework("CoreFoundation");
|
||||
step.linkFramework("CoreGraphics");
|
||||
step.linkFramework("CoreText");
|
||||
return lib;
|
||||
lib.linkFramework("Carbon");
|
||||
lib.linkFramework("CoreFoundation");
|
||||
lib.linkFramework("CoreGraphics");
|
||||
lib.linkFramework("CoreText");
|
||||
try apple_sdk.addPaths(b, lib);
|
||||
|
||||
b.installArtifact(lib);
|
||||
}
|
||||
|
7
pkg/macos/build.zig.zon
Normal file
7
pkg/macos/build.zig.zon
Normal file
@ -0,0 +1,7 @@
|
||||
.{
|
||||
.name = "macos",
|
||||
.version = "0.1.0",
|
||||
.dependencies = .{
|
||||
.apple_sdk = .{ .path = "../apple-sdk" },
|
||||
},
|
||||
}
|
Reference in New Issue
Block a user