1 # Copyright (c) 2009 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 'variables': { 7 'use_system_libevent%': 0, 8 }, 9 'conditions': [ 10 ['use_system_libevent==0', { 11 'targets': [ 12 { 13 'target_name': 'libevent', 14 'product_name': 'event', 15 'type': '<(library)', 16 'sources': [ 17 'buffer.c', 18 'evbuffer.c', 19 'evdns.c', 20 'event.c', 21 'event_tagging.c', 22 'evrpc.c', 23 'evutil.c', 24 'http.c', 25 'log.c', 26 'poll.c', 27 'select.c', 28 'signal.c', 29 'strlcpy.c', 30 ], 31 'defines': [ 32 'HAVE_CONFIG_H', 33 ], 34 'include_dirs': [ 35 '.', # libevent includes some of its own headers with 36 # #include <...> instead of #include "..." 37 ], 38 'conditions': [ 39 # libevent has platform-specific implementation files. Since its 40 # native build uses autoconf, platform-specific config.h files are 41 # provided and live in platform-specific directories. 42 [ 'OS == "linux"', { 43 'sources': [ 'epoll.c', 'epoll_sub.c' ], 44 'include_dirs': [ 'linux' ], 45 'link_settings': { 46 'libraries': [ 47 # We need rt for clock_gettime(). 48 # TODO(port) Maybe on FreeBSD as well? 49 '-lrt', 50 ], 51 }, 52 }], 53 [ 'OS == "mac" or OS == "freebsd" or OS == "openbsd" or OS == "solaris"', { 54 'sources': [ 'kqueue.c' ], 55 'include_dirs': [ 'mac' ] 56 }], 57 ], 58 }, 59 ], 60 }, { # use_system_libevent != 0 61 'targets': [ 62 { 63 'target_name': 'libevent', 64 'type': 'settings', 65 'direct_dependent_settings': { 66 'defines': [ 67 'USE_SYSTEM_LIBEVENT', 68 ], 69 }, 70 'link_settings': { 71 'libraries': [ 72 '-levent', 73 ], 74 }, 75 } 76 ], 77 }], 78 ], 79 } 80 81 # Local Variables: 82 # tab-width:2 83 # indent-tabs-mode:nil 84 # End: 85 # vim: set expandtab tabstop=2 shiftwidth=2: 86