blob: f11ba80517ccc51ec65069e37bdb1c3db1eb536d [file] [log] [blame]
btolsch9d6900c2018-05-30 18:22:53 -07001# Copyright 2018 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
Yuri Wiitalab2d13232019-02-04 18:07:28 -08005import("//build_overrides/build.gni")
btolsch5292c942018-07-26 00:06:22 -07006
Yuri Wiitalab2d13232019-02-04 18:07:28 -08007source_set("platform") {
8 defines = []
9
10 sources = [
11 "api/error.h",
12 "api/event_waiter.cc",
13 "api/event_waiter.h",
14 "api/logging.cc",
15 "api/logging.h",
16 "api/network_interface.cc",
17 "api/network_interface.h",
18 "api/socket.h.",
19 "api/time.h",
20 "base/event_loop.cc", # TODO: separate API from impl.
21 "base/event_loop.h", # TODO: separate API from impl.
22 ]
Jordan Bayles9eb09742019-01-15 14:04:52 -080023
24 public_deps = [
Yuri Wiitalab2d13232019-02-04 18:07:28 -080025 "//base",
Jordan Bayles9eb09742019-01-15 14:04:52 -080026 "//third_party/abseil",
27 ]
Yuri Wiitalab2d13232019-02-04 18:07:28 -080028
29 if (build_with_chromium) {
30 sources += [
31 "chromium/error.cc",
32 "chromium/event_waiter.cc",
33 "chromium/logging.cc",
34 "chromium/network_interface.cc",
35 "chromium/time.cc",
36 "chromium/socket.cc",
37 "chromium/socket.h",
38 ]
39 } else { # !build_with_chromium
40 sources += [
41 "base/logging.cc",
42 "base/time.cc",
43 ]
44
45 if (is_linux) {
46 sources += [ "linux/network_interface.cc" ]
47 } else if (is_mac) {
48 defines += [
49 # Required, to use the new IPv6 Sockets options introduced by RFC 3542.
50 "__APPLE_USE_RFC_3542",
51 ]
52 sources += [ "mac/network_interface.cc" ]
53 }
54
55 if (is_posix) {
56 sources += [
57 "posix/error.cc",
58 "posix/event_waiter.cc",
59 "posix/logging.cc",
60 "posix/socket.cc",
61 "posix/socket.h",
62 ]
63 }
64 }
btolsch9d6900c2018-05-30 18:22:53 -070065}