btolsch | 9d6900c | 2018-05-30 18:22:53 -0700 | [diff] [blame] | 1 | # 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 Wiitala | b2d1323 | 2019-02-04 18:07:28 -0800 | [diff] [blame] | 5 | import("//build_overrides/build.gni") |
btolsch | 5292c94 | 2018-07-26 00:06:22 -0700 | [diff] [blame] | 6 | |
Yuri Wiitala | b2d1323 | 2019-02-04 18:07:28 -0800 | [diff] [blame] | 7 | source_set("platform") { |
Ryan Keane | 1d9c0c4 | 2019-07-29 15:22:19 -0700 | [diff] [blame] | 8 | defines = [] |
| 9 | |
Yuri Wiitala | b2d1323 | 2019-02-04 18:07:28 -0800 | [diff] [blame] | 10 | sources = [ |
Ryan Keane | efab2ed | 2019-07-22 12:36:53 -0700 | [diff] [blame] | 11 | "api/internal/trace_logging_internal.cc", |
| 12 | "api/internal/trace_logging_internal.h", |
| 13 | "api/internal/trace_logging_macros_internal.h", |
Yuri Wiitala | b2d1323 | 2019-02-04 18:07:28 -0800 | [diff] [blame] | 14 | "api/logging.h", |
Jordan Bayles | ad2d2cd | 2019-05-22 14:49:40 -0700 | [diff] [blame] | 15 | "api/logging_util.cc", |
Yuri Wiitala | b2d1323 | 2019-02-04 18:07:28 -0800 | [diff] [blame] | 16 | "api/network_interface.cc", |
| 17 | "api/network_interface.h", |
Jordan Bayles | f3cf17d | 2019-06-11 15:29:43 -0700 | [diff] [blame] | 18 | "api/scoped_wake_lock.cc", |
| 19 | "api/scoped_wake_lock.h", |
btolsch | 4051e72 | 2019-06-07 16:15:17 -0700 | [diff] [blame] | 20 | "api/socket.h", |
Jordan Bayles | b0c191e | 2019-03-26 15:49:57 -0700 | [diff] [blame] | 21 | "api/task_runner.h", |
Yuri Wiitala | b2d1323 | 2019-02-04 18:07:28 -0800 | [diff] [blame] | 22 | "api/time.h", |
Ryan Keane | fdebe6c | 2019-09-06 14:12:51 -0700 | [diff] [blame] | 23 | "api/tls_connection.cc", |
Jordan Bayles | 1c785bd | 2019-08-15 10:32:33 -0700 | [diff] [blame] | 24 | "api/tls_connection.h", |
Ryan Keane | fdebe6c | 2019-09-06 14:12:51 -0700 | [diff] [blame] | 25 | "api/tls_connection_factory.cc", |
Jordan Bayles | 1c785bd | 2019-08-15 10:32:33 -0700 | [diff] [blame] | 26 | "api/tls_connection_factory.h", |
Ryan Keane | efab2ed | 2019-07-22 12:36:53 -0700 | [diff] [blame] | 27 | "api/trace_logging.h", |
| 28 | "api/trace_logging_platform.cc", |
| 29 | "api/trace_logging_platform.h", |
| 30 | "api/trace_logging_types.h", |
Max Yakimakha | 04362e2 | 2019-07-22 17:54:45 -0700 | [diff] [blame] | 31 | "api/udp_packet.h", |
| 32 | "api/udp_read_callback.h", |
Ryan Keane | deb48b3 | 2019-06-28 16:24:40 -0700 | [diff] [blame] | 33 | "api/udp_socket.cc", |
Jordan Bayles | ad2d2cd | 2019-05-22 14:49:40 -0700 | [diff] [blame] | 34 | "api/udp_socket.h", |
Jordan Bayles | a26582d | 2019-07-10 14:44:58 -0700 | [diff] [blame] | 35 | "base/error.cc", |
| 36 | "base/error.h", |
| 37 | "base/ip_address.cc", |
| 38 | "base/ip_address.h", |
| 39 | "base/location.cc", |
| 40 | "base/location.h", |
Jordan Bayles | 1c785bd | 2019-08-15 10:32:33 -0700 | [diff] [blame] | 41 | "base/socket_state.h", |
| 42 | "base/tls_connect_options.h", |
| 43 | "base/tls_credentials.cc", |
| 44 | "base/tls_credentials.h", |
| 45 | "base/tls_listen_options.h", |
Yuri Wiitala | b2d1323 | 2019-02-04 18:07:28 -0800 | [diff] [blame] | 46 | ] |
Jordan Bayles | 9eb0974 | 2019-01-15 14:04:52 -0800 | [diff] [blame] | 47 | |
| 48 | public_deps = [ |
btolsch | 2f2e7fa | 2019-03-29 16:48:49 -0700 | [diff] [blame] | 49 | "../third_party/abseil", |
Jordan Bayles | b9262f4 | 2019-05-30 14:10:02 -0700 | [diff] [blame] | 50 | "../third_party/boringssl", |
Jordan Bayles | a26582d | 2019-07-10 14:44:58 -0700 | [diff] [blame] | 51 | "../util", |
Jordan Bayles | 9eb0974 | 2019-01-15 14:04:52 -0800 | [diff] [blame] | 52 | ] |
Jordan Bayles | 9ade415 | 2019-05-08 17:03:24 -0700 | [diff] [blame] | 53 | |
Jordan Bayles | a80724b | 2019-05-02 17:17:26 -0700 | [diff] [blame] | 54 | configs += [ "../build:allow_build_from_embedder" ] |
Yuri Wiitala | b2d1323 | 2019-02-04 18:07:28 -0800 | [diff] [blame] | 55 | |
Jordan Bayles | a80724b | 2019-05-02 17:17:26 -0700 | [diff] [blame] | 56 | if (!build_with_chromium) { |
btolsch | c92ba2f | 2019-04-10 11:46:01 -0700 | [diff] [blame] | 57 | sources += [ |
Jordan Bayles | cc47180 | 2019-07-09 14:25:02 -0700 | [diff] [blame] | 58 | "impl/network_reader.cc", |
| 59 | "impl/network_reader.h", |
Ryan Keane | ecdb30e | 2019-09-04 12:17:34 -0700 | [diff] [blame] | 60 | "impl/network_reader_thread.cc", |
| 61 | "impl/network_reader_thread.h", |
Ryan Keane | 3b88a25 | 2019-09-17 09:55:33 -0700 | [diff] [blame^] | 62 | "impl/network_waiter.h", |
| 63 | "impl/socket_handle.h", |
Jordan Bayles | a26582d | 2019-07-10 14:44:58 -0700 | [diff] [blame] | 64 | "impl/task_runner.cc", |
| 65 | "impl/task_runner.h", |
Ryan Keane | ecdb30e | 2019-09-04 12:17:34 -0700 | [diff] [blame] | 66 | "impl/task_runner_thread.cc", |
| 67 | "impl/task_runner_thread.h", |
Ryan Keane | efab2ed | 2019-07-22 12:36:53 -0700 | [diff] [blame] | 68 | "impl/text_trace_logging_platform.cc", |
| 69 | "impl/text_trace_logging_platform.h", |
btolsch | 4397c29 | 2019-07-22 12:42:10 -0700 | [diff] [blame] | 70 | "impl/time.cc", |
btolsch | c92ba2f | 2019-04-10 11:46:01 -0700 | [diff] [blame] | 71 | ] |
Yuri Wiitala | b2d1323 | 2019-02-04 18:07:28 -0800 | [diff] [blame] | 72 | |
| 73 | if (is_linux) { |
Jordan Bayles | cc47180 | 2019-07-09 14:25:02 -0700 | [diff] [blame] | 74 | sources += [ "impl/network_interface_linux.cc" ] |
Yuri Wiitala | b2d1323 | 2019-02-04 18:07:28 -0800 | [diff] [blame] | 75 | } else if (is_mac) { |
Ryan Keane | 1d9c0c4 | 2019-07-29 15:22:19 -0700 | [diff] [blame] | 76 | defines += [ |
Yuri Wiitala | b2d1323 | 2019-02-04 18:07:28 -0800 | [diff] [blame] | 77 | # Required, to use the new IPv6 Sockets options introduced by RFC 3542. |
| 78 | "__APPLE_USE_RFC_3542", |
| 79 | ] |
Jordan Bayles | 9ade415 | 2019-05-08 17:03:24 -0700 | [diff] [blame] | 80 | |
Jordan Bayles | cc47180 | 2019-07-09 14:25:02 -0700 | [diff] [blame] | 81 | sources += [ "impl/network_interface_mac.cc" ] |
Yuri Wiitala | b2d1323 | 2019-02-04 18:07:28 -0800 | [diff] [blame] | 82 | } |
| 83 | |
| 84 | if (is_posix) { |
| 85 | sources += [ |
Jordan Bayles | cc47180 | 2019-07-09 14:25:02 -0700 | [diff] [blame] | 86 | "impl/network_waiter_posix.cc", |
| 87 | "impl/network_waiter_posix.h", |
Jordan Bayles | a26582d | 2019-07-10 14:44:58 -0700 | [diff] [blame] | 88 | "impl/scoped_pipe.h", |
Jordan Bayles | cc47180 | 2019-07-09 14:25:02 -0700 | [diff] [blame] | 89 | "impl/scoped_wake_lock_posix.cc", |
| 90 | "impl/scoped_wake_lock_posix.h", |
Jordan Bayles | 62b7c6a | 2019-08-15 10:32:33 -0700 | [diff] [blame] | 91 | "impl/socket_address_posix.cc", |
| 92 | "impl/socket_address_posix.h", |
Ryan Keane | 6e54252 | 2019-09-10 16:05:44 -0700 | [diff] [blame] | 93 | "impl/socket_handle_posix.cc", |
| 94 | "impl/socket_handle_posix.h", |
Jordan Bayles | 1c785bd | 2019-08-15 10:32:33 -0700 | [diff] [blame] | 95 | "impl/stream_socket.h", |
Jordan Bayles | 62b7c6a | 2019-08-15 10:32:33 -0700 | [diff] [blame] | 96 | "impl/stream_socket_posix.cc", |
| 97 | "impl/stream_socket_posix.h", |
Jordan Bayles | 1c785bd | 2019-08-15 10:32:33 -0700 | [diff] [blame] | 98 | "impl/tls_connection_factory_posix.cc", |
| 99 | "impl/tls_connection_factory_posix.h", |
| 100 | "impl/tls_connection_posix.cc", |
| 101 | "impl/tls_connection_posix.h", |
Jordan Bayles | cc47180 | 2019-07-09 14:25:02 -0700 | [diff] [blame] | 102 | "impl/udp_socket_posix.cc", |
| 103 | "impl/udp_socket_posix.h", |
Yuri Wiitala | b2d1323 | 2019-02-04 18:07:28 -0800 | [diff] [blame] | 104 | ] |
| 105 | } |
Jordan Bayles | 9ade415 | 2019-05-08 17:03:24 -0700 | [diff] [blame] | 106 | |
| 107 | deps = [ |
Jordan Bayles | ad2d2cd | 2019-05-22 14:49:40 -0700 | [diff] [blame] | 108 | ":default_logger", |
Jordan Bayles | 9ade415 | 2019-05-08 17:03:24 -0700 | [diff] [blame] | 109 | ] |
Yuri Wiitala | b2d1323 | 2019-02-04 18:07:28 -0800 | [diff] [blame] | 110 | } |
btolsch | 9d6900c | 2018-05-30 18:22:53 -0700 | [diff] [blame] | 111 | } |
Yuri Wiitala | eb8eee7 | 2019-03-26 15:52:43 -0700 | [diff] [blame] | 112 | |
Jordan Bayles | aa021ce | 2019-05-29 13:57:44 -0700 | [diff] [blame] | 113 | source_set("test") { |
| 114 | testonly = true |
| 115 | sources = [ |
| 116 | "test/fake_clock.cc", |
| 117 | "test/fake_clock.h", |
Yuri Wiitala | ec35361 | 2019-06-18 17:32:39 -0700 | [diff] [blame] | 118 | "test/fake_task_runner.cc", |
| 119 | "test/fake_task_runner.h", |
Ryan Keane | 7d4b5fc | 2019-08-30 12:38:39 -0700 | [diff] [blame] | 120 | "test/fake_udp_socket.cc", |
| 121 | "test/fake_udp_socket.h", |
Ryan Keane | 38e7d51 | 2019-08-02 15:37:49 -0700 | [diff] [blame] | 122 | "test/trace_logging_helpers.h", |
Jordan Bayles | aa021ce | 2019-05-29 13:57:44 -0700 | [diff] [blame] | 123 | ] |
| 124 | |
Jordan Bayles | 7bc7f10 | 2019-05-30 12:38:43 -0700 | [diff] [blame] | 125 | configs += [ "../build:allow_build_from_embedder" ] |
| 126 | |
Jordan Bayles | aa021ce | 2019-05-29 13:57:44 -0700 | [diff] [blame] | 127 | deps = [ |
| 128 | ":platform", |
Ryan Keane | deb48b3 | 2019-06-28 16:24:40 -0700 | [diff] [blame] | 129 | "../third_party/googletest:gmock", |
Jordan Bayles | aa021ce | 2019-05-29 13:57:44 -0700 | [diff] [blame] | 130 | ] |
| 131 | } |
| 132 | |
Jordan Bayles | 9ade415 | 2019-05-08 17:03:24 -0700 | [diff] [blame] | 133 | source_set("default_logger") { |
| 134 | sources = [ |
Jordan Bayles | cc47180 | 2019-07-09 14:25:02 -0700 | [diff] [blame] | 135 | "impl/logging.cc", |
Jordan Bayles | 9ade415 | 2019-05-08 17:03:24 -0700 | [diff] [blame] | 136 | ] |
| 137 | |
| 138 | if (is_posix) { |
Jordan Bayles | cc47180 | 2019-07-09 14:25:02 -0700 | [diff] [blame] | 139 | sources += [ "impl/log_initializer_posix.cc" ] |
Jordan Bayles | 9ade415 | 2019-05-08 17:03:24 -0700 | [diff] [blame] | 140 | } |
| 141 | |
| 142 | configs += [ "../build:allow_build_from_embedder" ] |
| 143 | |
| 144 | deps = [ |
Jordan Bayles | 9ade415 | 2019-05-08 17:03:24 -0700 | [diff] [blame] | 145 | "../third_party/abseil", |
Jordan Bayles | a26582d | 2019-07-10 14:44:58 -0700 | [diff] [blame] | 146 | "../util", |
Jordan Bayles | 9ade415 | 2019-05-08 17:03:24 -0700 | [diff] [blame] | 147 | ] |
| 148 | } |
| 149 | |
Yuri Wiitala | eb8eee7 | 2019-03-26 15:52:43 -0700 | [diff] [blame] | 150 | source_set("platform_unittests") { |
| 151 | testonly = true |
| 152 | |
| 153 | sources = [ |
Ryan Keane | efab2ed | 2019-07-22 12:36:53 -0700 | [diff] [blame] | 154 | "api/internal/trace_logging_internal_unittest.cc", |
Yuri Wiitala | eb8eee7 | 2019-03-26 15:52:43 -0700 | [diff] [blame] | 155 | "api/time_unittest.cc", |
Ryan Keane | efab2ed | 2019-07-22 12:36:53 -0700 | [diff] [blame] | 156 | "api/trace_logging_unittest.cc", |
Ryan Keane | 493029d | 2019-08-19 14:01:04 -0700 | [diff] [blame] | 157 | "api/udp_socket_unittest.cc", |
Jordan Bayles | a26582d | 2019-07-10 14:44:58 -0700 | [diff] [blame] | 158 | "base/error_unittest.cc", |
| 159 | "base/ip_address_unittest.cc", |
| 160 | "base/location_unittest.cc", |
Jordan Bayles | 05ce6b6 | 2019-09-06 14:09:10 -0700 | [diff] [blame] | 161 | "base/tls_credentials_unittest.cc", |
Yuri Wiitala | eb8eee7 | 2019-03-26 15:52:43 -0700 | [diff] [blame] | 162 | ] |
| 163 | |
Jordan Bayles | cc47180 | 2019-07-09 14:25:02 -0700 | [diff] [blame] | 164 | # The unit tests in impl/ assume the standalone implementation is being used. |
Yuri Wiitala | eb8eee7 | 2019-03-26 15:52:43 -0700 | [diff] [blame] | 165 | # Exclude them if an embedder is providing the implementation. |
| 166 | if (!build_with_chromium) { |
btolsch | c92ba2f | 2019-04-10 11:46:01 -0700 | [diff] [blame] | 167 | sources += [ |
Jordan Bayles | 063c3b5 | 2019-08-13 18:14:55 -0700 | [diff] [blame] | 168 | # TODO(jophba): move over to general sources when UDP socket create |
| 169 | # is implemented in Chromium, as part of the NetworkRunner work. |
Ryan Keane | 493029d | 2019-08-19 14:01:04 -0700 | [diff] [blame] | 170 | "api/socket_integration_unittest.cc", |
Jordan Bayles | cc47180 | 2019-07-09 14:25:02 -0700 | [diff] [blame] | 171 | "impl/network_reader_unittest.cc", |
Jordan Bayles | a26582d | 2019-07-10 14:44:58 -0700 | [diff] [blame] | 172 | "impl/task_runner_unittest.cc", |
Jordan Bayles | cc47180 | 2019-07-09 14:25:02 -0700 | [diff] [blame] | 173 | "impl/time_unittest.cc", |
btolsch | c92ba2f | 2019-04-10 11:46:01 -0700 | [diff] [blame] | 174 | ] |
Jordan Bayles | 063c3b5 | 2019-08-13 18:14:55 -0700 | [diff] [blame] | 175 | |
Ryan Keane | 32c88d0 | 2019-07-02 18:46:14 -0700 | [diff] [blame] | 176 | if (is_posix) { |
Jordan Bayles | a26582d | 2019-07-10 14:44:58 -0700 | [diff] [blame] | 177 | sources += [ |
| 178 | "impl/network_waiter_posix_unittest.cc", |
| 179 | "impl/scoped_pipe_unittest.cc", |
Jordan Bayles | 62b7c6a | 2019-08-15 10:32:33 -0700 | [diff] [blame] | 180 | "impl/socket_address_posix_unittest.cc", |
Jordan Bayles | a26582d | 2019-07-10 14:44:58 -0700 | [diff] [blame] | 181 | ] |
Ryan Keane | 32c88d0 | 2019-07-02 18:46:14 -0700 | [diff] [blame] | 182 | } |
Yuri Wiitala | eb8eee7 | 2019-03-26 15:52:43 -0700 | [diff] [blame] | 183 | } |
| 184 | |
| 185 | deps = [ |
| 186 | ":platform", |
Ryan Keane | deb48b3 | 2019-06-28 16:24:40 -0700 | [diff] [blame] | 187 | "../third_party/googletest:gmock", |
btolsch | 4666ed2 | 2019-04-25 15:58:07 -0700 | [diff] [blame] | 188 | "../third_party/googletest:gtest", |
Yuri Wiitala | eb8eee7 | 2019-03-26 15:52:43 -0700 | [diff] [blame] | 189 | ] |
Jordan Bayles | 9ade415 | 2019-05-08 17:03:24 -0700 | [diff] [blame] | 190 | |
| 191 | configs += [ "../build:allow_build_from_embedder" ] |
Yuri Wiitala | eb8eee7 | 2019-03-26 15:52:43 -0700 | [diff] [blame] | 192 | } |