mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00
improve building on darwin
This commit is contained in:
@ -4,6 +4,7 @@ const LibExeObjStep = std.build.LibExeObjStep;
|
|||||||
const glfw = @import("vendor/mach/glfw/build.zig");
|
const glfw = @import("vendor/mach/glfw/build.zig");
|
||||||
const ft = @import("src/freetype/build.zig");
|
const ft = @import("src/freetype/build.zig");
|
||||||
const uv = @import("src/libuv/build.zig");
|
const uv = @import("src/libuv/build.zig");
|
||||||
|
const system_sdk = @import("vendor/mach/glfw/system_sdk.zig");
|
||||||
|
|
||||||
pub fn build(b: *std.build.Builder) !void {
|
pub fn build(b: *std.build.Builder) !void {
|
||||||
const target = b.standardTargetOptions(.{});
|
const target = b.standardTargetOptions(.{});
|
||||||
@ -26,6 +27,7 @@ pub fn build(b: *std.build.Builder) !void {
|
|||||||
ftlib.link(exe);
|
ftlib.link(exe);
|
||||||
|
|
||||||
const libuv = try uv.create(b, target, mode);
|
const libuv = try uv.create(b, target, mode);
|
||||||
|
system_sdk.include(b, libuv.step, .{});
|
||||||
libuv.link(exe);
|
libuv.link(exe);
|
||||||
|
|
||||||
// stb if we need it
|
// stb if we need it
|
||||||
|
@ -50,6 +50,13 @@ pub fn create(
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (target.isDarwin()) {
|
||||||
|
try flags.appendSlice(&.{
|
||||||
|
"-D_DARWIN_UNLIMITED_SELECT=1",
|
||||||
|
"-D_DARWIN_USE_64_BIT_INODE=1",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// C files common to all platforms
|
// C files common to all platforms
|
||||||
ret.addCSourceFiles(&.{
|
ret.addCSourceFiles(&.{
|
||||||
root() ++ "src/fs-poll.c",
|
root() ++ "src/fs-poll.c",
|
||||||
@ -106,6 +113,32 @@ pub fn create(
|
|||||||
}, flags.items);
|
}, flags.items);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (target.isDarwin() or
|
||||||
|
target.isOpenBSD() or
|
||||||
|
target.isNetBSD() or
|
||||||
|
target.isFreeBSD() or
|
||||||
|
target.isDragonFlyBSD())
|
||||||
|
{
|
||||||
|
ret.addCSourceFiles(&.{
|
||||||
|
root() ++ "src/unix/bsd-ifaddrs.c",
|
||||||
|
root() ++ "src/unix/kqueue.c",
|
||||||
|
}, flags.items);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (target.isDarwin() or target.isOpenBSD()) {
|
||||||
|
ret.addCSourceFiles(&.{
|
||||||
|
root() ++ "src/unix/random-getentropy.c",
|
||||||
|
}, flags.items);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (target.isDarwin()) {
|
||||||
|
ret.addCSourceFiles(&.{
|
||||||
|
root() ++ "src/unix/darwin-proctitle.c",
|
||||||
|
root() ++ "src/unix/darwin.c",
|
||||||
|
root() ++ "src/unix/fsevents.c",
|
||||||
|
}, flags.items);
|
||||||
|
}
|
||||||
|
|
||||||
ret.addIncludeDir(include_dir);
|
ret.addIncludeDir(include_dir);
|
||||||
ret.addIncludeDir(root() ++ "src");
|
ret.addIncludeDir(root() ++ "src");
|
||||||
if (target.isWindows()) {
|
if (target.isWindows()) {
|
||||||
|
Reference in New Issue
Block a user