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