3 'uv_use_dtrace%': 'false',
4 # uv_parent_path is the relative path to libuv in the parent project
5 # this is only relevant when dtrace is enabled and libuv is a child project
6 # as it's necessary to correctly locate the object files for post
8 # XXX gyp is quite sensitive about paths with double / they don't normalize
17 '_FILE_OFFSET_BITS=64',
21 'cflags': [ '-pthreads' ],
23 ['OS not in "solaris android"', {
24 'cflags': [ '-pthread' ],
33 'target_name': 'libuv',
39 'direct_dependent_settings': {
40 'include_dirs': [ 'include' ],
45 '_FILE_OFFSET_BITS=64',
49 'defines': [ '_DARWIN_USE_64_BIT_INODE=1' ],
52 'defines': [ '_POSIX_C_SOURCE=200112' ],
74 '_WIN32_WINNT=0x0600',
80 'src/win/atomicops-inl.h',
86 'src/win/getaddrinfo.c',
88 'src/win/handle-inl.h',
90 'src/win/loop-watcher.c',
95 'src/win/process-stdio.c',
100 'src/win/stream-inl.h',
103 'src/win/threadpool.c',
121 }, { # Not Windows i.e. POSIX
128 '-Wno-unused-parameter',
132 'include/uv-linux.h',
133 'include/uv-sunos.h',
134 'include/uv-darwin.h',
137 'src/unix/atomic-ops.h',
141 'src/unix/getaddrinfo.c',
142 'src/unix/internal.h',
144 'src/unix/loop-watcher.c',
147 'src/unix/process.c',
149 'src/unix/spinlock.h',
153 'src/unix/threadpool.c',
159 'libraries': [ '-lm' ],
162 'ldflags': [ '-pthreads' ],
164 ['OS != "solaris" and OS != "android"', {
165 'ldflags': [ '-pthread' ],
170 ['library=="shared_library"', {
171 'cflags': [ '-fPIC' ],
173 ['library=="shared_library" and OS!="mac"', {
175 # Must correspond with UV_VERSION_MAJOR and UV_VERSION_MINOR
177 'libraries': [ '-Wl,-soname,libuv.so.0.11' ],
182 [ 'OS in "linux mac android"', {
183 'sources': [ 'src/unix/proctitle.c' ],
188 'src/unix/fsevents.c',
189 'src/unix/darwin-proctitle.c',
192 '_DARWIN_USE_64_BIT_INODE=1',
196 # Enable on all platforms except OS X. The antique gcc/clang that
197 # ships with Xcode emits waaaay too many false positives.
198 'cflags': [ '-Wstrict-aliasing' ],
202 'src/unix/linux-core.c',
203 'src/unix/linux-inotify.c',
204 'src/unix/linux-syscalls.c',
205 'src/unix/linux-syscalls.h',
208 'libraries': [ '-ldl', '-lrt' ],
213 'src/unix/linux-core.c',
214 'src/unix/linux-inotify.c',
215 'src/unix/linux-syscalls.c',
216 'src/unix/linux-syscalls.h',
217 'src/unix/pthread-fixes.c',
220 'libraries': [ '-ldl' ],
224 'sources': [ 'src/unix/sunos.c' ],
239 'include_dirs': [ 'src/ares/config_aix' ],
240 'sources': [ 'src/unix/aix.c' ],
251 [ 'OS=="freebsd" or OS=="dragonflybsd"', {
252 'sources': [ 'src/unix/freebsd.c' ],
255 'sources': [ 'src/unix/openbsd.c' ],
258 'sources': [ 'src/unix/netbsd.c' ],
260 [ 'OS in "freebsd dragonflybsd openbsd netbsd".split()', {
262 'libraries': [ '-lkvm' ],
265 [ 'OS in "mac freebsd dragonflybsd openbsd netbsd".split()', {
266 'sources': [ 'src/unix/kqueue.c' ],
268 ['library=="shared_library"', {
269 'defines': [ 'BUILDING_UV_SHARED=1' ]
271 # FIXME(bnoordhuis or tjfontaine) Unify this, it's extremely ugly.
272 ['uv_use_dtrace=="true"', {
273 'defines': [ 'HAVE_DTRACE=1' ],
274 'dependencies': [ 'uv_dtrace_header' ],
275 'include_dirs': [ '<(SHARED_INTERMEDIATE_DIR)' ],
277 [ 'OS not in "mac linux"', {
278 'sources': [ 'src/unix/dtrace.c' ],
281 'sources': [ '<(SHARED_INTERMEDIATE_DIR)/dtrace.o' ]
289 'target_name': 'run-tests',
290 'type': 'executable',
291 'dependencies': [ 'libuv' ],
293 'test/blackhole-server.c',
294 'test/echo-server.c',
298 'test/test-get-loadavg.c',
300 'test/test-active.c',
302 'test/test-async-null-cb.c',
303 'test/test-callback-stack.c',
304 'test/test-callback-order.c',
305 'test/test-close-fd.c',
306 'test/test-close-order.c',
307 'test/test-connection-fail.c',
308 'test/test-cwd-and-chdir.c',
309 'test/test-delayed-accept.c',
312 'test/test-emfile.c',
313 'test/test-fail-always.c',
315 'test/test-fs-event.c',
316 'test/test-get-currentexe.c',
317 'test/test-get-memory.c',
318 'test/test-getaddrinfo.c',
319 'test/test-getsockname.c',
320 'test/test-hrtime.c',
323 'test/test-ipc-send-recv.c',
325 'test/test-loop-handles.c',
326 'test/test-loop-stop.c',
327 'test/test-loop-time.c',
328 'test/test-walk-handles.c',
329 'test/test-watcher-cross-stop.c',
330 'test/test-multiple-listen.c',
331 'test/test-osx-select.c',
332 'test/test-pass-always.c',
333 'test/test-ping-pong.c',
334 'test/test-pipe-bind-error.c',
335 'test/test-pipe-connect-error.c',
336 'test/test-platform-output.c',
338 'test/test-poll-close.c',
339 'test/test-process-title.c',
341 'test/test-run-nowait.c',
342 'test/test-run-once.c',
343 'test/test-semaphore.c',
344 'test/test-shutdown-close.c',
345 'test/test-shutdown-eof.c',
346 'test/test-signal.c',
347 'test/test-signal-multiple-loops.c',
349 'test/test-fs-poll.c',
350 'test/test-stdio-over-pipes.c',
351 'test/test-tcp-bind-error.c',
352 'test/test-tcp-bind6-error.c',
353 'test/test-tcp-close.c',
354 'test/test-tcp-close-accept.c',
355 'test/test-tcp-close-while-connecting.c',
356 'test/test-tcp-connect-error-after-write.c',
357 'test/test-tcp-shutdown-after-write.c',
358 'test/test-tcp-flags.c',
359 'test/test-tcp-connect-error.c',
360 'test/test-tcp-connect-timeout.c',
361 'test/test-tcp-connect6-error.c',
362 'test/test-tcp-open.c',
363 'test/test-tcp-write-to-half-open-connection.c',
364 'test/test-tcp-writealot.c',
365 'test/test-tcp-try-write.c',
366 'test/test-tcp-unexpected-read.c',
367 'test/test-tcp-read-stop.c',
368 'test/test-threadpool.c',
369 'test/test-threadpool-cancel.c',
370 'test/test-mutexes.c',
371 'test/test-thread.c',
372 'test/test-barrier.c',
373 'test/test-condvar.c',
374 'test/test-timer-again.c',
375 'test/test-timer-from-check.c',
378 'test/test-udp-dgram-too-big.c',
379 'test/test-udp-ipv6.c',
380 'test/test-udp-open.c',
381 'test/test-udp-options.c',
382 'test/test-udp-send-and-recv.c',
383 'test/test-udp-multicast-join.c',
384 'test/test-dlerror.c',
385 'test/test-udp-multicast-ttl.c',
386 'test/test-ip4-addr.c',
387 'test/test-ip6-addr.c',
395 'libraries': [ 'ws2_32.lib' ]
397 'defines': [ '_GNU_SOURCE' ],
399 'test/runner-unix.c',
400 'test/runner-unix.h',
403 [ 'OS=="solaris"', { # make test-fs.c compile, needs _POSIX_C_SOURCE
409 [ 'OS=="aix"', { # make test-fs.c compile, needs _POSIX_C_SOURCE
418 'SubSystem': 1, # /subsystem:console
424 'target_name': 'run-benchmarks',
425 'type': 'executable',
426 'dependencies': [ 'libuv' ],
428 'test/benchmark-async.c',
429 'test/benchmark-async-pummel.c',
430 'test/benchmark-fs-stat.c',
431 'test/benchmark-getaddrinfo.c',
432 'test/benchmark-list.h',
433 'test/benchmark-loop-count.c',
434 'test/benchmark-million-async.c',
435 'test/benchmark-million-timers.c',
436 'test/benchmark-multi-accept.c',
437 'test/benchmark-ping-pongs.c',
438 'test/benchmark-pound.c',
439 'test/benchmark-pump.c',
440 'test/benchmark-sizes.c',
441 'test/benchmark-spawn.c',
442 'test/benchmark-thread.c',
443 'test/benchmark-tcp-write-batch.c',
444 'test/benchmark-udp-pummel.c',
446 'test/echo-server.c',
447 'test/blackhole-server.c',
448 'test/run-benchmarks.c',
459 'libraries': [ 'ws2_32.lib' ]
461 'defines': [ '_GNU_SOURCE' ],
463 'test/runner-unix.c',
464 'test/runner-unix.h',
470 'SubSystem': 1, # /subsystem:console
476 'target_name': 'uv_dtrace_header',
479 [ 'uv_use_dtrace=="true"', {
482 'action_name': 'uv_dtrace_header',
483 'inputs': [ 'src/unix/uv-dtrace.d' ],
484 'outputs': [ '<(SHARED_INTERMEDIATE_DIR)/uv-dtrace.h' ],
485 'action': [ 'dtrace', '-h', '-xnolibs', '-s', '<@(_inputs)',
486 '-o', '<@(_outputs)' ],
493 # FIXME(bnoordhuis or tjfontaine) Unify this, it's extremely ugly.
495 'target_name': 'uv_dtrace_provider',
498 [ 'uv_use_dtrace=="true" and OS not in "mac linux"', {
501 'action_name': 'uv_dtrace_o',
503 'src/unix/uv-dtrace.d',
504 '<(PRODUCT_DIR)/obj.target/libuv<(uv_parent_path)src/unix/core.o',
507 '<(PRODUCT_DIR)/obj.target/libuv<(uv_parent_path)src/unix/dtrace.o',
509 'action': [ 'dtrace', '-G', '-xnolibs', '-s', '<@(_inputs)',
510 '-o', '<@(_outputs)' ]
514 [ 'uv_use_dtrace=="true" and OS=="linux"', {
517 'action_name': 'uv_dtrace_o',
518 'inputs': [ 'src/unix/uv-dtrace.d' ],
519 'outputs': [ '<(SHARED_INTERMEDIATE_DIR)/dtrace.o' ],
521 'dtrace', '-C', '-G', '-s', '<@(_inputs)', '-o', '<@(_outputs)'