1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Use of this source code is governed by a BSD-style license that can be 3 # found in the LICENSE file. 4 5 { 6 'targets': [ 7 { 8 'target_name': 'libevent', 9 'product_name': 'event', 10 'type': 'static_library', 11 'toolsets': ['host', 'target'], 12 'sources': [ 13 'buffer.c', 14 'evbuffer.c', 15 'evdns.c', 16 'event.c', 17 'event_tagging.c', 18 'evrpc.c', 19 'evutil.c', 20 'http.c', 21 'log.c', 22 'poll.c', 23 'select.c', 24 'signal.c', 25 'strlcpy.c', 26 ], 27 'defines': [ 28 'HAVE_CONFIG_H', 29 ], 30 'conditions': [ 31 # libevent has platform-specific implementation files. Since its 32 # native build uses autoconf, platform-specific config.h files are 33 # provided and live in platform-specific directories. 34 [ 'OS == "linux" or (OS == "android" and _toolset == "host")', { 35 'sources': [ 'epoll.c', 'epoll_sub.c' ], 36 'include_dirs': [ 'linux' ], 37 'link_settings': { 38 'libraries': [ 39 # We need rt for clock_gettime(). 40 # TODO(port) Maybe on FreeBSD as well? 41 '-lrt', 42 ], 43 }, 44 }], 45 [ 'OS == "android" and _toolset == "target"', { 46 # On android, epoll_create(), epoll_ctl(), epoll_wait() and 47 # clock_gettime() are all in libc.so, so no need to add 48 # epoll_sub.c and link librt. 49 'sources': [ 'epoll.c' ], 50 'include_dirs': [ 'android' ], 51 }], 52 [ 'OS == "mac" or OS == "ios" or os_bsd==1', { 53 'sources': [ 'kqueue.c' ], 54 'include_dirs': [ 'mac' ] 55 }], 56 [ 'OS == "solaris"', { 57 'sources': [ 'devpoll.c', 'evport.c' ], 58 'include_dirs': [ 'solaris' ] 59 }], 60 ], 61 }, 62 ], 63 } 64