| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 { | 5 { |
| 6 'variables': { | 6 'targets': [ |
| 7 'use_system_libevent%': 0, | 7 { |
| 8 }, | 8 'target_name': 'libevent', |
| 9 'conditions': [ | 9 'product_name': 'event', |
| 10 ['use_system_libevent==0', { | 10 'type': 'static_library', |
| 11 'targets': [ | 11 'toolsets': ['host', 'target'], |
| 12 { | 12 'sources': [ |
| 13 'target_name': 'libevent', | 13 'buffer.c', |
| 14 'product_name': 'event', | 14 'evbuffer.c', |
| 15 'type': 'static_library', | 15 'evdns.c', |
| 16 'toolsets': ['host', 'target'], | 16 'event.c', |
| 17 'sources': [ | 17 'event_tagging.c', |
| 18 'buffer.c', | 18 'evrpc.c', |
| 19 'evbuffer.c', | 19 'evutil.c', |
| 20 'evdns.c', | 20 'http.c', |
| 21 'event.c', | 21 'log.c', |
| 22 'event_tagging.c', | 22 'poll.c', |
| 23 'evrpc.c', | 23 'select.c', |
| 24 'evutil.c', | 24 'signal.c', |
| 25 'http.c', | 25 'strlcpy.c', |
| 26 'log.c', | |
| 27 'poll.c', | |
| 28 'select.c', | |
| 29 'signal.c', | |
| 30 'strlcpy.c', | |
| 31 ], | |
| 32 'defines': [ | |
| 33 'HAVE_CONFIG_H', | |
| 34 ], | |
| 35 'conditions': [ | |
| 36 # libevent has platform-specific implementation files. Since its | |
| 37 # native build uses autoconf, platform-specific config.h files are | |
| 38 # provided and live in platform-specific directories. | |
| 39 [ 'OS == "linux" or (OS == "android" and _toolset == "host")', { | |
| 40 'sources': [ 'epoll.c', 'epoll_sub.c' ], | |
| 41 'include_dirs': [ 'linux' ], | |
| 42 'link_settings': { | |
| 43 'libraries': [ | |
| 44 # We need rt for clock_gettime(). | |
| 45 # TODO(port) Maybe on FreeBSD as well? | |
| 46 '-lrt', | |
| 47 ], | |
| 48 }, | |
| 49 }], | |
| 50 [ 'OS == "android" and _toolset == "target"', { | |
| 51 # On android, epoll_create(), epoll_ctl(), epoll_wait() and | |
| 52 # clock_gettime() are all in libc.so, so no need to add | |
| 53 # epoll_sub.c and link librt. | |
| 54 'sources': [ 'epoll.c' ], | |
| 55 'include_dirs': [ 'android' ], | |
| 56 }], | |
| 57 [ 'OS == "mac" or OS == "ios" or os_bsd==1', { | |
| 58 'sources': [ 'kqueue.c' ], | |
| 59 'include_dirs': [ 'mac' ] | |
| 60 }], | |
| 61 [ 'OS == "solaris"', { | |
| 62 'sources': [ 'devpoll.c', 'evport.c' ], | |
| 63 'include_dirs': [ 'solaris' ] | |
| 64 }], | |
| 65 ], | |
| 66 }, | |
| 67 ], | 26 ], |
| 68 }, { # use_system_libevent != 0 | 27 'defines': [ |
| 69 'targets': [ | 28 'HAVE_CONFIG_H', |
| 70 { | 29 ], |
| 71 'target_name': 'libevent', | 30 'conditions': [ |
| 72 'type': 'none', | 31 # libevent has platform-specific implementation files. Since its |
| 73 'toolsets': ['host', 'target'], | 32 # native build uses autoconf, platform-specific config.h files are |
| 74 'variables': { | 33 # provided and live in platform-specific directories. |
| 75 'headers_root_path': '.', | 34 [ 'OS == "linux" or (OS == "android" and _toolset == "host")', { |
| 76 'header_filenames': [ | 35 'sources': [ 'epoll.c', 'epoll_sub.c' ], |
| 77 'event.h', | 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', |
| 78 ], | 42 ], |
| 79 }, | 43 }, |
| 80 'includes': [ | 44 }], |
| 81 '../../build/shim_headers.gypi', | 45 [ 'OS == "android" and _toolset == "target"', { |
| 82 ], | 46 # On android, epoll_create(), epoll_ctl(), epoll_wait() and |
| 83 'link_settings': { | 47 # clock_gettime() are all in libc.so, so no need to add |
| 84 'libraries': [ | 48 # epoll_sub.c and link librt. |
| 85 '-levent', | 49 'sources': [ 'epoll.c' ], |
| 86 ], | 50 'include_dirs': [ 'android' ], |
| 87 }, | 51 }], |
| 88 } | 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 }], |
| 89 ], | 60 ], |
| 90 }], | 61 }, |
| 91 ], | 62 ], |
| 92 } | 63 } |
| OLD | NEW |