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