blob: daa89a5f15c0434d82183df2053fdec5f497d394 [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.",
18 "api/time.h",
btolsch2f2e7fa2019-03-29 16:48:49 -070019 "base/event_loop.cc",
20 "base/event_loop.h",
21 "base/time.cc",
Yuri Wiitalab2d13232019-02-04 18:07:28 -080022 ]
Jordan Bayles9eb09742019-01-15 14:04:52 -080023
btolsch2f2e7fa2019-03-29 16:48:49 -070024 deps = []
Jordan Bayles9eb09742019-01-15 14:04:52 -080025 public_deps = [
btolsch2f2e7fa2019-03-29 16:48:49 -070026 "../base",
27 "../third_party/abseil",
Jordan Bayles9eb09742019-01-15 14:04:52 -080028 ]
btolsch2f2e7fa2019-03-29 16:48:49 -070029 configs += [ "..:root_config_overrides" ]
Yuri Wiitalab2d13232019-02-04 18:07:28 -080030
31 if (build_with_chromium) {
btolsch2f2e7fa2019-03-29 16:48:49 -070032 deps += [ ":chromium" ]
33 public_deps += [ "//base" ]
Yuri Wiitalab2d13232019-02-04 18:07:28 -080034 } else { # !build_with_chromium
btolsch2f2e7fa2019-03-29 16:48:49 -070035 sources += [ "base/logging.cc" ]
Yuri Wiitalab2d13232019-02-04 18:07:28 -080036
37 if (is_linux) {
38 sources += [ "linux/network_interface.cc" ]
39 } else if (is_mac) {
40 defines += [
41 # Required, to use the new IPv6 Sockets options introduced by RFC 3542.
42 "__APPLE_USE_RFC_3542",
43 ]
44 sources += [ "mac/network_interface.cc" ]
45 }
46
47 if (is_posix) {
48 sources += [
Yuri Wiitalab2d13232019-02-04 18:07:28 -080049 "posix/event_waiter.cc",
50 "posix/logging.cc",
51 "posix/socket.cc",
52 "posix/socket.h",
53 ]
54 }
55 }
btolsch9d6900c2018-05-30 18:22:53 -070056}
Yuri Wiitalaeb8eee72019-03-26 15:52:43 -070057
btolsch2f2e7fa2019-03-29 16:48:49 -070058if (build_with_chromium) {
59 source_set("chromium") {
60 sources = [
61 "chromium/logging.cc",
62 ]
63
64 deps = [
65 "../third_party/abseil",
66 "//base",
67 ]
68
69 configs += [ "..:root_config_overrides" ]
70 }
71}
72
Yuri Wiitalaeb8eee72019-03-26 15:52:43 -070073source_set("platform_unittests") {
74 testonly = true
75
76 sources = [
77 "api/time_unittest.cc",
78 ]
79
80 # The unit tests in base/ assume the standalone implementation is being used.
81 # Exclude them if an embedder is providing the implementation.
82 if (!build_with_chromium) {
83 sources += [ "base/time_unittest.cc" ]
84 }
85
86 deps = [
87 ":platform",
88 "//third_party/googletest:gtest",
89 ]
btolsch2f2e7fa2019-03-29 16:48:49 -070090
91 configs += [ "..:root_config_overrides" ]
Yuri Wiitalaeb8eee72019-03-26 15:52:43 -070092}