blob: a80e1f38be7611a71a171b2617286447bcf4ae45 [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") {
Yuri Wiitalab2d13232019-02-04 18:07:28 -08008 sources = [
Yuri Wiitalab2d13232019-02-04 18:07:28 -08009 "api/event_waiter.cc",
10 "api/event_waiter.h",
Yuri Wiitalab2d13232019-02-04 18:07:28 -080011 "api/logging.h",
Jordan Baylesad2d2cd2019-05-22 14:49:40 -070012 "api/logging_util.cc",
Yuri Wiitalab2d13232019-02-04 18:07:28 -080013 "api/network_interface.cc",
14 "api/network_interface.h",
btolsch4051e722019-06-07 16:15:17 -070015 "api/network_runner.cc",
16 "api/network_runner.h",
17 "api/socket.h",
Jordan Baylesb0c191e2019-03-26 15:49:57 -070018 "api/task_runner.h",
Yuri Wiitalab2d13232019-02-04 18:07:28 -080019 "api/time.h",
Jordan Baylesa5ac5c82019-05-22 14:49:40 -070020 "api/tls_socket.h",
21 "api/tls_socket_creds.h",
Jordan Baylesad2d2cd2019-05-22 14:49:40 -070022 "api/udp_socket.h",
btolsch4051e722019-06-07 16:15:17 -070023 "api/upd_callbacks.h",
Jordan Baylesb9262f42019-05-30 14:10:02 -070024 "base/ssl_context.cc",
25 "base/ssl_context.h",
btolsch2f2e7fa2019-03-29 16:48:49 -070026 "base/time.cc",
Yuri Wiitalab2d13232019-02-04 18:07:28 -080027 ]
Jordan Bayles9eb09742019-01-15 14:04:52 -080028
29 public_deps = [
Jordan Baylesf1e4bb72019-05-01 12:38:39 -070030 "../osp_base",
btolsch2f2e7fa2019-03-29 16:48:49 -070031 "../third_party/abseil",
Jordan Baylesb9262f42019-05-30 14:10:02 -070032 "../third_party/boringssl",
Jordan Bayles9eb09742019-01-15 14:04:52 -080033 ]
Jordan Bayles9ade4152019-05-08 17:03:24 -070034
Jordan Baylesf1e4bb72019-05-01 12:38:39 -070035 allow_circular_includes_from = [ "../osp_base" ]
Jordan Bayles9ade4152019-05-08 17:03:24 -070036
Jordan Baylesa80724b2019-05-02 17:17:26 -070037 configs += [ "../build:allow_build_from_embedder" ]
Yuri Wiitalab2d13232019-02-04 18:07:28 -080038
Jordan Baylesa80724b2019-05-02 17:17:26 -070039 if (!build_with_chromium) {
btolschc92ba2f2019-04-10 11:46:01 -070040 sources += [
btolsch4666ed22019-04-25 15:58:07 -070041 "base/event_loop.cc",
42 "base/event_loop.h",
btolschc92ba2f2019-04-10 11:46:01 -070043 "base/task_runner_impl.cc",
44 "base/task_runner_impl.h",
45 ]
Yuri Wiitalab2d13232019-02-04 18:07:28 -080046
47 if (is_linux) {
48 sources += [ "linux/network_interface.cc" ]
49 } else if (is_mac) {
Jordan Baylesa80724b2019-05-02 17:17:26 -070050 defines = [
Yuri Wiitalab2d13232019-02-04 18:07:28 -080051 # Required, to use the new IPv6 Sockets options introduced by RFC 3542.
52 "__APPLE_USE_RFC_3542",
53 ]
Jordan Bayles9ade4152019-05-08 17:03:24 -070054
Yuri Wiitalab2d13232019-02-04 18:07:28 -080055 sources += [ "mac/network_interface.cc" ]
56 }
57
58 if (is_posix) {
59 sources += [
Yuri Wiitalab2d13232019-02-04 18:07:28 -080060 "posix/event_waiter.cc",
Jordan Baylesad2d2cd2019-05-22 14:49:40 -070061 "posix/udp_socket.cc",
62 "posix/udp_socket.h",
Yuri Wiitalab2d13232019-02-04 18:07:28 -080063 ]
64 }
Jordan Bayles9ade4152019-05-08 17:03:24 -070065
66 deps = [
Jordan Baylesad2d2cd2019-05-22 14:49:40 -070067 ":default_logger",
Jordan Bayles9ade4152019-05-08 17:03:24 -070068 ]
Yuri Wiitalab2d13232019-02-04 18:07:28 -080069 }
btolsch9d6900c2018-05-30 18:22:53 -070070}
Yuri Wiitalaeb8eee72019-03-26 15:52:43 -070071
Jordan Baylesaa021ce2019-05-29 13:57:44 -070072source_set("test") {
73 testonly = true
74 sources = [
75 "test/fake_clock.cc",
76 "test/fake_clock.h",
77 ]
78
Jordan Bayles7bc7f102019-05-30 12:38:43 -070079 configs += [ "../build:allow_build_from_embedder" ]
80
Jordan Baylesaa021ce2019-05-29 13:57:44 -070081 deps = [
82 ":platform",
83 ]
84}
85
Jordan Bayles9ade4152019-05-08 17:03:24 -070086source_set("default_logger") {
87 sources = [
88 "base/logging.cc",
89 ]
90
91 if (is_posix) {
Jordan Baylesad2d2cd2019-05-22 14:49:40 -070092 sources += [ "posix/log_initializer.cc" ]
Jordan Bayles9ade4152019-05-08 17:03:24 -070093 }
94
95 configs += [ "../build:allow_build_from_embedder" ]
96
97 deps = [
98 "../osp_base",
99 "../third_party/abseil",
100 ]
101}
102
Yuri Wiitalaeb8eee72019-03-26 15:52:43 -0700103source_set("platform_unittests") {
104 testonly = true
105
106 sources = [
107 "api/time_unittest.cc",
Jordan Baylesb9262f42019-05-30 14:10:02 -0700108 "base/ssl_context_unittest.cc",
Yuri Wiitalaeb8eee72019-03-26 15:52:43 -0700109 ]
110
111 # The unit tests in base/ assume the standalone implementation is being used.
112 # Exclude them if an embedder is providing the implementation.
113 if (!build_with_chromium) {
btolschc92ba2f2019-04-10 11:46:01 -0700114 sources += [
btolsch4051e722019-06-07 16:15:17 -0700115 "base/task_runner_impl_unittest.cc",
btolschc92ba2f2019-04-10 11:46:01 -0700116 "base/time_unittest.cc",
117 ]
Yuri Wiitalaeb8eee72019-03-26 15:52:43 -0700118 }
119
120 deps = [
121 ":platform",
btolsch4666ed22019-04-25 15:58:07 -0700122 "../third_party/googletest:gtest",
Yuri Wiitalaeb8eee72019-03-26 15:52:43 -0700123 ]
Jordan Bayles9ade4152019-05-08 17:03:24 -0700124
125 configs += [ "../build:allow_build_from_embedder" ]
Yuri Wiitalaeb8eee72019-03-26 15:52:43 -0700126}