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.", |
| 18 | "api/time.h", |
| 19 | "base/event_loop.cc", # TODO: separate API from impl. |
| 20 | "base/event_loop.h", # TODO: separate API from impl. |
| 21 | ] |
Jordan Bayles | 9eb0974 | 2019-01-15 14:04:52 -0800 | [diff] [blame] | 22 | |
| 23 | public_deps = [ |
Yuri Wiitala | b2d1323 | 2019-02-04 18:07:28 -0800 | [diff] [blame] | 24 | "//base", |
Jordan Bayles | 9eb0974 | 2019-01-15 14:04:52 -0800 | [diff] [blame] | 25 | "//third_party/abseil", |
| 26 | ] |
Yuri Wiitala | b2d1323 | 2019-02-04 18:07:28 -0800 | [diff] [blame] | 27 | |
| 28 | if (build_with_chromium) { |
| 29 | sources += [ |
Yuri Wiitala | b2d1323 | 2019-02-04 18:07:28 -0800 | [diff] [blame] | 30 | "chromium/event_waiter.cc", |
| 31 | "chromium/logging.cc", |
| 32 | "chromium/network_interface.cc", |
Yuri Wiitala | b2d1323 | 2019-02-04 18:07:28 -0800 | [diff] [blame] | 33 | "chromium/socket.cc", |
| 34 | "chromium/socket.h", |
Yuri Wiitala | 10dea9f | 2019-02-04 20:19:17 -0800 | [diff] [blame] | 35 | "chromium/time.cc", |
Yuri Wiitala | b2d1323 | 2019-02-04 18:07:28 -0800 | [diff] [blame] | 36 | ] |
| 37 | } else { # !build_with_chromium |
| 38 | sources += [ |
| 39 | "base/logging.cc", |
| 40 | "base/time.cc", |
| 41 | ] |
| 42 | |
| 43 | if (is_linux) { |
| 44 | sources += [ "linux/network_interface.cc" ] |
| 45 | } else if (is_mac) { |
| 46 | defines += [ |
| 47 | # Required, to use the new IPv6 Sockets options introduced by RFC 3542. |
| 48 | "__APPLE_USE_RFC_3542", |
| 49 | ] |
| 50 | sources += [ "mac/network_interface.cc" ] |
| 51 | } |
| 52 | |
| 53 | if (is_posix) { |
| 54 | sources += [ |
Yuri Wiitala | b2d1323 | 2019-02-04 18:07:28 -0800 | [diff] [blame] | 55 | "posix/event_waiter.cc", |
| 56 | "posix/logging.cc", |
| 57 | "posix/socket.cc", |
| 58 | "posix/socket.h", |
| 59 | ] |
| 60 | } |
| 61 | } |
btolsch | 9d6900c | 2018-05-30 18:22:53 -0700 | [diff] [blame] | 62 | } |
Yuri Wiitala | eb8eee7 | 2019-03-26 15:52:43 -0700 | [diff] [blame^] | 63 | |
| 64 | source_set("platform_unittests") { |
| 65 | testonly = true |
| 66 | |
| 67 | sources = [ |
| 68 | "api/time_unittest.cc", |
| 69 | ] |
| 70 | |
| 71 | # The unit tests in base/ assume the standalone implementation is being used. |
| 72 | # Exclude them if an embedder is providing the implementation. |
| 73 | if (!build_with_chromium) { |
| 74 | sources += [ "base/time_unittest.cc" ] |
| 75 | } |
| 76 | |
| 77 | deps = [ |
| 78 | ":platform", |
| 79 | "//third_party/googletest:gtest", |
| 80 | ] |
| 81 | } |