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