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()) {
|
if (step.target.isDarwin()) {
|
||||||
step.addModule("objc", objc_dep.module("objc"));
|
step.addModule("objc", objc_dep.module("objc"));
|
||||||
step.addModule("macos", macos_dep.module("macos"));
|
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.
|
// todo: do this is in zig-objc instead.
|
||||||
step.linkSystemLibraryName("objc");
|
step.linkSystemLibraryName("objc");
|
||||||
|
@ -1,52 +1,34 @@
|
|||||||
const std = @import("std");
|
const std = @import("std");
|
||||||
const builtin = @import("builtin");
|
const builtin = @import("builtin");
|
||||||
|
const apple_sdk = @import("apple_sdk");
|
||||||
|
|
||||||
pub fn build(b: *std.Build) !void {
|
pub fn build(b: *std.Build) !void {
|
||||||
const target = b.standardTargetOptions(.{});
|
const target = b.standardTargetOptions(.{});
|
||||||
const optimize = b.standardOptimizeOption(.{});
|
const optimize = b.standardOptimizeOption(.{});
|
||||||
_ = target;
|
|
||||||
_ = optimize;
|
|
||||||
|
|
||||||
_ = b.addModule("macos", .{ .source_file = .{ .path = "main.zig" } });
|
_ = 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(.{
|
const lib = b.addStaticLibrary(.{
|
||||||
.name = "macos",
|
.name = "macos",
|
||||||
.target = step.target,
|
.target = target,
|
||||||
.optimize = step.optimize,
|
.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,
|
.flags = flags.items,
|
||||||
});
|
});
|
||||||
step.addCSourceFile(.{
|
lib.addCSourceFile(.{
|
||||||
.file = .{ .path = comptime thisDir() ++ "/text/ext.c" },
|
.file = .{ .path = "text/ext.c" },
|
||||||
.flags = flags.items,
|
.flags = flags.items,
|
||||||
});
|
});
|
||||||
step.linkFramework("Carbon");
|
lib.linkFramework("Carbon");
|
||||||
step.linkFramework("CoreFoundation");
|
lib.linkFramework("CoreFoundation");
|
||||||
step.linkFramework("CoreGraphics");
|
lib.linkFramework("CoreGraphics");
|
||||||
step.linkFramework("CoreText");
|
lib.linkFramework("CoreText");
|
||||||
return lib;
|
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