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