Skip to content

Commit

Permalink
Add Apple compatible build configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
darrinsmart authored and legeana committed May 31, 2020
1 parent b363e5c commit 0cb91eb
Showing 1 changed file with 31 additions and 8 deletions.
39 changes: 31 additions & 8 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,23 @@ uvsrc = [
'src/unix/thread.c',
'src/unix/timer.c',
'src/unix/tty.c',
'src/unix/udp.c',
'src/unix/linux-core.c',
'src/unix/linux-inotify.c',
'src/unix/linux-syscalls.c',
'src/unix/procfs-exepath.c',
'src/unix/proctitle.c',
'src/unix/sysinfo-loadavg.c',
'src/unix/sysinfo-memory.c',
'src/unix/udp.c'
]

# Linux systems
if cc.get_define('__linux__') != ''
uvsrc += [
'src/unix/linux-core.c',
'src/unix/linux-inotify.c',
'src/unix/linux-syscalls.c',
'src/unix/procfs-exepath.c',
'src/unix/proctitle.c',
'src/unix/sysinfo-loadavg.c',
'src/unix/sysinfo-memory.c',
]
endif


uvdefines = [ '-D_GNU_SOURCE', ]
add_project_arguments(
# https://github.com/libuv/libuv/issues/2603
Expand All @@ -48,6 +55,22 @@ if cc.get_define('__ANDROID__') != ''
'src/unix/pthread-fixes.c' ]
endif

# OSX systems
if cc.get_define('__APPLE__') != ''
uvsrc += [
'src/unix/bsd-ifaddrs.c',
'src/unix/darwin.c',
'src/unix/darwin-proctitle.c',
'src/unix/fsevents.c',
'src/unix/kqueue.c',
'src/unix/proctitle.c'
]
uvdefines += [
'-D_DARWIN_USE_64_BIT_INODE=1',
'-D_DARWIN_UNLIMITED_SELECT=1'
]
endif

pthread = dependency('threads')

libuv_deps = [ cc.find_library('m', required: false),
Expand Down

0 comments on commit 0cb91eb

Please sign in to comment.