improve building on darwin

This commit is contained in:
Mitchell Hashimoto
2022-04-23 14:00:21 -07:00
parent 2bb2897d63
commit 8b0d914ddc
2 changed files with 35 additions and 0 deletions

View File

@@ -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
ret.addCSourceFiles(&.{
root() ++ "src/fs-poll.c",
@@ -106,6 +113,32 @@ pub fn create(
}, 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(root() ++ "src");
if (target.isWindows()) {