xref: /aosp_15_r20/external/cronet/third_party/libevent/BUILD.gn (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1# Copyright 2013 The Chromium Authors
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5import("//build/config/cronet/config.gni")
6import("//build/config/nacl/config.gni")
7
8static_library("libevent") {
9  sources = [
10    "event-config.h",
11    "event-internal.h",
12    "event.c",
13    "event.h",
14    "evsignal.h",
15    "evutil.c",
16    "evutil.h",
17    "log.c",
18    "log.h",
19    "min_heap.h",
20    "poll.c",
21    "select.c",
22    "signal.c",
23    "strlcpy-internal.h",
24    "strlcpy.c",
25  ]
26
27  defines = [ "HAVE_CONFIG_H" ]
28  if (is_cronet_build) {
29    include_dirs = [ "compat" ]
30  } else {
31    include_dirs = []
32  }
33  if (is_apple) {
34    sources += [
35      "kqueue.c",
36      "mac/config.h",
37      "mac/event-config.h",
38    ]
39    include_dirs += [ "mac" ]
40  } else if (is_linux || is_chromeos) {
41    sources += [
42      "epoll.c",
43      "linux/config.h",
44      "linux/event-config.h",
45    ]
46    include_dirs += [ "linux" ]
47  } else if (is_android) {
48    sources += [
49      "android/config.h",
50      "android/event-config.h",
51      "epoll.c",
52    ]
53    include_dirs += [ "android" ]
54  }
55
56  if (!is_debug) {
57    configs -= [ "//build/config/compiler:default_optimization" ]
58    configs += [ "//build/config/compiler:optimize_max" ]
59  }
60
61  configs -= [ "//build/config/compiler:chromium_code" ]
62  configs += [ "//build/config/compiler:no_chromium_code" ]
63}
64