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") { |
Yuri Wiitala | b2d1323 | 2019-02-04 18:07:28 -0800 | [diff] [blame] | 8 | sources = [ |
Yuri Wiitala | b2d1323 | 2019-02-04 18:07:28 -0800 | [diff] [blame] | 9 | "api/event_waiter.cc", |
| 10 | "api/event_waiter.h", |
Yuri Wiitala | b2d1323 | 2019-02-04 18:07:28 -0800 | [diff] [blame] | 11 | "api/logging.h", |
Jordan Bayles | ad2d2cd | 2019-05-22 14:49:40 -0700 | [diff] [blame] | 12 | "api/logging_util.cc", |
Yuri Wiitala | b2d1323 | 2019-02-04 18:07:28 -0800 | [diff] [blame] | 13 | "api/network_interface.cc", |
| 14 | "api/network_interface.h", |
btolsch | 4051e72 | 2019-06-07 16:15:17 -0700 | [diff] [blame] | 15 | "api/network_runner.h", |
Ryan Keane | 32c88d0 | 2019-07-02 18:46:14 -0700 | [diff] [blame^] | 16 | "api/network_waiter.h", |
btolsch | 4051e72 | 2019-06-07 16:15:17 -0700 | [diff] [blame] | 17 | "api/socket.h", |
Jordan Bayles | b0c191e | 2019-03-26 15:49:57 -0700 | [diff] [blame] | 18 | "api/task_runner.h", |
Yuri Wiitala | b2d1323 | 2019-02-04 18:07:28 -0800 | [diff] [blame] | 19 | "api/time.h", |
Jordan Bayles | a5ac5c8 | 2019-05-22 14:49:40 -0700 | [diff] [blame] | 20 | "api/tls_socket.h", |
| 21 | "api/tls_socket_creds.h", |
Ryan Keane | deb48b3 | 2019-06-28 16:24:40 -0700 | [diff] [blame] | 22 | "api/udp_socket.cc", |
Jordan Bayles | ad2d2cd | 2019-05-22 14:49:40 -0700 | [diff] [blame] | 23 | "api/udp_socket.h", |
Ryan Keane | 32c88d0 | 2019-07-02 18:46:14 -0700 | [diff] [blame^] | 24 | "api/upd_read_callback.h", |
Jordan Bayles | b9262f4 | 2019-05-30 14:10:02 -0700 | [diff] [blame] | 25 | "base/ssl_context.cc", |
| 26 | "base/ssl_context.h", |
btolsch | 2f2e7fa | 2019-03-29 16:48:49 -0700 | [diff] [blame] | 27 | "base/time.cc", |
Yuri Wiitala | b2d1323 | 2019-02-04 18:07:28 -0800 | [diff] [blame] | 28 | ] |
Jordan Bayles | 9eb0974 | 2019-01-15 14:04:52 -0800 | [diff] [blame] | 29 | |
| 30 | public_deps = [ |
Jordan Bayles | f1e4bb7 | 2019-05-01 12:38:39 -0700 | [diff] [blame] | 31 | "../osp_base", |
btolsch | 2f2e7fa | 2019-03-29 16:48:49 -0700 | [diff] [blame] | 32 | "../third_party/abseil", |
Jordan Bayles | b9262f4 | 2019-05-30 14:10:02 -0700 | [diff] [blame] | 33 | "../third_party/boringssl", |
Jordan Bayles | 9eb0974 | 2019-01-15 14:04:52 -0800 | [diff] [blame] | 34 | ] |
Jordan Bayles | 9ade415 | 2019-05-08 17:03:24 -0700 | [diff] [blame] | 35 | |
Jordan Bayles | f1e4bb7 | 2019-05-01 12:38:39 -0700 | [diff] [blame] | 36 | allow_circular_includes_from = [ "../osp_base" ] |
Jordan Bayles | 9ade415 | 2019-05-08 17:03:24 -0700 | [diff] [blame] | 37 | |
Jordan Bayles | a80724b | 2019-05-02 17:17:26 -0700 | [diff] [blame] | 38 | configs += [ "../build:allow_build_from_embedder" ] |
Yuri Wiitala | b2d1323 | 2019-02-04 18:07:28 -0800 | [diff] [blame] | 39 | |
Jordan Bayles | a80724b | 2019-05-02 17:17:26 -0700 | [diff] [blame] | 40 | if (!build_with_chromium) { |
btolsch | c92ba2f | 2019-04-10 11:46:01 -0700 | [diff] [blame] | 41 | sources += [ |
btolsch | 4666ed2 | 2019-04-25 15:58:07 -0700 | [diff] [blame] | 42 | "base/event_loop.cc", |
| 43 | "base/event_loop.h", |
Ryan Keane | 32c88d0 | 2019-07-02 18:46:14 -0700 | [diff] [blame^] | 44 | "base/network_reader.cc", |
| 45 | "base/network_reader.h", |
| 46 | "base/network_runner_impl.cc", |
| 47 | "base/network_runner_impl.h", |
btolsch | c92ba2f | 2019-04-10 11:46:01 -0700 | [diff] [blame] | 48 | "base/task_runner_impl.cc", |
| 49 | "base/task_runner_impl.h", |
| 50 | ] |
Yuri Wiitala | b2d1323 | 2019-02-04 18:07:28 -0800 | [diff] [blame] | 51 | |
| 52 | if (is_linux) { |
| 53 | sources += [ "linux/network_interface.cc" ] |
| 54 | } else if (is_mac) { |
Jordan Bayles | a80724b | 2019-05-02 17:17:26 -0700 | [diff] [blame] | 55 | defines = [ |
Yuri Wiitala | b2d1323 | 2019-02-04 18:07:28 -0800 | [diff] [blame] | 56 | # Required, to use the new IPv6 Sockets options introduced by RFC 3542. |
| 57 | "__APPLE_USE_RFC_3542", |
| 58 | ] |
Jordan Bayles | 9ade415 | 2019-05-08 17:03:24 -0700 | [diff] [blame] | 59 | |
Yuri Wiitala | b2d1323 | 2019-02-04 18:07:28 -0800 | [diff] [blame] | 60 | sources += [ "mac/network_interface.cc" ] |
| 61 | } |
| 62 | |
| 63 | if (is_posix) { |
| 64 | sources += [ |
Yuri Wiitala | b2d1323 | 2019-02-04 18:07:28 -0800 | [diff] [blame] | 65 | "posix/event_waiter.cc", |
Ryan Keane | 32c88d0 | 2019-07-02 18:46:14 -0700 | [diff] [blame^] | 66 | "posix/network_waiter.cc", |
| 67 | "posix/network_waiter.h", |
Jordan Bayles | ad2d2cd | 2019-05-22 14:49:40 -0700 | [diff] [blame] | 68 | "posix/udp_socket.cc", |
| 69 | "posix/udp_socket.h", |
Yuri Wiitala | b2d1323 | 2019-02-04 18:07:28 -0800 | [diff] [blame] | 70 | ] |
| 71 | } |
Jordan Bayles | 9ade415 | 2019-05-08 17:03:24 -0700 | [diff] [blame] | 72 | |
| 73 | deps = [ |
Jordan Bayles | ad2d2cd | 2019-05-22 14:49:40 -0700 | [diff] [blame] | 74 | ":default_logger", |
Jordan Bayles | 9ade415 | 2019-05-08 17:03:24 -0700 | [diff] [blame] | 75 | ] |
Yuri Wiitala | b2d1323 | 2019-02-04 18:07:28 -0800 | [diff] [blame] | 76 | } |
btolsch | 9d6900c | 2018-05-30 18:22:53 -0700 | [diff] [blame] | 77 | } |
Yuri Wiitala | eb8eee7 | 2019-03-26 15:52:43 -0700 | [diff] [blame] | 78 | |
Jordan Bayles | aa021ce | 2019-05-29 13:57:44 -0700 | [diff] [blame] | 79 | source_set("test") { |
| 80 | testonly = true |
| 81 | sources = [ |
| 82 | "test/fake_clock.cc", |
| 83 | "test/fake_clock.h", |
Yuri Wiitala | ec35361 | 2019-06-18 17:32:39 -0700 | [diff] [blame] | 84 | "test/fake_task_runner.cc", |
| 85 | "test/fake_task_runner.h", |
Ryan Keane | deb48b3 | 2019-06-28 16:24:40 -0700 | [diff] [blame] | 86 | "test/mock_udp_socket.cc", |
| 87 | "test/mock_udp_socket.h", |
Jordan Bayles | aa021ce | 2019-05-29 13:57:44 -0700 | [diff] [blame] | 88 | ] |
| 89 | |
Jordan Bayles | 7bc7f10 | 2019-05-30 12:38:43 -0700 | [diff] [blame] | 90 | configs += [ "../build:allow_build_from_embedder" ] |
| 91 | |
Jordan Bayles | aa021ce | 2019-05-29 13:57:44 -0700 | [diff] [blame] | 92 | deps = [ |
| 93 | ":platform", |
Ryan Keane | deb48b3 | 2019-06-28 16:24:40 -0700 | [diff] [blame] | 94 | "../third_party/googletest:gmock", |
Jordan Bayles | aa021ce | 2019-05-29 13:57:44 -0700 | [diff] [blame] | 95 | ] |
| 96 | } |
| 97 | |
Jordan Bayles | 9ade415 | 2019-05-08 17:03:24 -0700 | [diff] [blame] | 98 | source_set("default_logger") { |
| 99 | sources = [ |
| 100 | "base/logging.cc", |
| 101 | ] |
| 102 | |
| 103 | if (is_posix) { |
Jordan Bayles | ad2d2cd | 2019-05-22 14:49:40 -0700 | [diff] [blame] | 104 | sources += [ "posix/log_initializer.cc" ] |
Jordan Bayles | 9ade415 | 2019-05-08 17:03:24 -0700 | [diff] [blame] | 105 | } |
| 106 | |
| 107 | configs += [ "../build:allow_build_from_embedder" ] |
| 108 | |
| 109 | deps = [ |
| 110 | "../osp_base", |
| 111 | "../third_party/abseil", |
| 112 | ] |
| 113 | } |
| 114 | |
Yuri Wiitala | eb8eee7 | 2019-03-26 15:52:43 -0700 | [diff] [blame] | 115 | source_set("platform_unittests") { |
| 116 | testonly = true |
| 117 | |
| 118 | sources = [ |
| 119 | "api/time_unittest.cc", |
Ryan Keane | deb48b3 | 2019-06-28 16:24:40 -0700 | [diff] [blame] | 120 | "api/udp_socket_unittest.cc", |
Jordan Bayles | b9262f4 | 2019-05-30 14:10:02 -0700 | [diff] [blame] | 121 | "base/ssl_context_unittest.cc", |
Yuri Wiitala | eb8eee7 | 2019-03-26 15:52:43 -0700 | [diff] [blame] | 122 | ] |
| 123 | |
| 124 | # The unit tests in base/ assume the standalone implementation is being used. |
| 125 | # Exclude them if an embedder is providing the implementation. |
| 126 | if (!build_with_chromium) { |
btolsch | c92ba2f | 2019-04-10 11:46:01 -0700 | [diff] [blame] | 127 | sources += [ |
Ryan Keane | 32c88d0 | 2019-07-02 18:46:14 -0700 | [diff] [blame^] | 128 | "base/network_reader_unittest.cc", |
btolsch | 4051e72 | 2019-06-07 16:15:17 -0700 | [diff] [blame] | 129 | "base/task_runner_impl_unittest.cc", |
btolsch | c92ba2f | 2019-04-10 11:46:01 -0700 | [diff] [blame] | 130 | "base/time_unittest.cc", |
| 131 | ] |
Ryan Keane | 32c88d0 | 2019-07-02 18:46:14 -0700 | [diff] [blame^] | 132 | if (is_posix) { |
| 133 | sources += [ "posix/network_waiter_unittest.cc" ] |
| 134 | } |
Yuri Wiitala | eb8eee7 | 2019-03-26 15:52:43 -0700 | [diff] [blame] | 135 | } |
| 136 | |
| 137 | deps = [ |
| 138 | ":platform", |
Ryan Keane | deb48b3 | 2019-06-28 16:24:40 -0700 | [diff] [blame] | 139 | "../third_party/googletest:gmock", |
btolsch | 4666ed2 | 2019-04-25 15:58:07 -0700 | [diff] [blame] | 140 | "../third_party/googletest:gtest", |
Yuri Wiitala | eb8eee7 | 2019-03-26 15:52:43 -0700 | [diff] [blame] | 141 | ] |
Jordan Bayles | 9ade415 | 2019-05-08 17:03:24 -0700 | [diff] [blame] | 142 | |
| 143 | configs += [ "../build:allow_build_from_embedder" ] |
Yuri Wiitala | eb8eee7 | 2019-03-26 15:52:43 -0700 | [diff] [blame] | 144 | } |