blob: 949101a9510b2efb6db28ddc456385cf8ee312ac [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 = [
Yuri Wiitalab2d13232019-02-04 18:07:28 -080011 "api/event_waiter.cc",
12 "api/event_waiter.h",
13 "api/logging.cc",
14 "api/logging.h",
15 "api/network_interface.cc",
16 "api/network_interface.h",
17 "api/socket.h.",
Jordan Baylesb0c191e2019-03-26 15:49:57 -070018 "api/task_runner.h",
19 "api/task_runner_factory.h",
Yuri Wiitalab2d13232019-02-04 18:07:28 -080020 "api/time.h",
btolsch2f2e7fa2019-03-29 16:48:49 -070021 "base/event_loop.cc",
22 "base/event_loop.h",
23 "base/time.cc",
Yuri Wiitalab2d13232019-02-04 18:07:28 -080024 ]
Jordan Bayles9eb09742019-01-15 14:04:52 -080025
btolsch2f2e7fa2019-03-29 16:48:49 -070026 deps = []
Jordan Bayles9eb09742019-01-15 14:04:52 -080027 public_deps = [
btolsch2f2e7fa2019-03-29 16:48:49 -070028 "../base",
29 "../third_party/abseil",
Jordan Bayles9eb09742019-01-15 14:04:52 -080030 ]
btolsch2f2e7fa2019-03-29 16:48:49 -070031 configs += [ "..:root_config_overrides" ]
Yuri Wiitalab2d13232019-02-04 18:07:28 -080032
33 if (build_with_chromium) {
btolsch2f2e7fa2019-03-29 16:48:49 -070034 deps += [ ":chromium" ]
35 public_deps += [ "//base" ]
Yuri Wiitalab2d13232019-02-04 18:07:28 -080036 } else { # !build_with_chromium
btolsch2f2e7fa2019-03-29 16:48:49 -070037 sources += [ "base/logging.cc" ]
Yuri Wiitalab2d13232019-02-04 18:07:28 -080038
39 if (is_linux) {
40 sources += [ "linux/network_interface.cc" ]
41 } else if (is_mac) {
42 defines += [
43 # Required, to use the new IPv6 Sockets options introduced by RFC 3542.
44 "__APPLE_USE_RFC_3542",
45 ]
46 sources += [ "mac/network_interface.cc" ]
47 }
48
49 if (is_posix) {
50 sources += [
Yuri Wiitalab2d13232019-02-04 18:07:28 -080051 "posix/event_waiter.cc",
52 "posix/logging.cc",
53 "posix/socket.cc",
54 "posix/socket.h",
55 ]
56 }
57 }
btolsch9d6900c2018-05-30 18:22:53 -070058}
Yuri Wiitalaeb8eee72019-03-26 15:52:43 -070059
btolsch2f2e7fa2019-03-29 16:48:49 -070060if (build_with_chromium) {
61 source_set("chromium") {
62 sources = [
63 "chromium/logging.cc",
64 ]
65
66 deps = [
67 "../third_party/abseil",
68 "//base",
69 ]
70
71 configs += [ "..:root_config_overrides" ]
72 }
73}
74
Yuri Wiitalaeb8eee72019-03-26 15:52:43 -070075source_set("platform_unittests") {
76 testonly = true
77
78 sources = [
79 "api/time_unittest.cc",
80 ]
81
82 # The unit tests in base/ assume the standalone implementation is being used.
83 # Exclude them if an embedder is providing the implementation.
84 if (!build_with_chromium) {
85 sources += [ "base/time_unittest.cc" ]
86 }
87
88 deps = [
89 ":platform",
90 "//third_party/googletest:gtest",
91 ]
btolsch2f2e7fa2019-03-29 16:48:49 -070092
93 configs += [ "..:root_config_overrides" ]
Yuri Wiitalaeb8eee72019-03-26 15:52:43 -070094}