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